From: hboehm Date: Tue, 15 Sep 2009 18:24:57 +0000 (+0000) Subject: 2009-09-15 Hans Boehm (Mostly Juan Jose Garcia-Ripoll) X-Git-Tag: gc7_2alpha4~136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=668f3d9bd54e6d4bf494ab995fc648a4f8bbdcce;p=gc 2009-09-15 Hans Boehm (Mostly Juan Jose Garcia-Ripoll) (Also similar to, but not the same as, Ivan's diff104_cvs) * os_dep.c (GC_forward_exception): Fix logic in several places. (OSX-specific) --- diff --git a/ChangeLog b/ChangeLog index 4e56a031..004d645b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-15 Hans Boehm (Mostly Juan Jose Garcia-Ripoll) + (Also similar to, but not the same as, Ivan's diff104_cvs) + + * os_dep.c (GC_forward_exception): Fix logic in several places. + (OSX-specific) 2009-09-15 Ivan Maidanski (ivmai137v2.diff) diff --git a/os_dep.c b/os_dep.c index 3cc6d497..6aaaa10a 100644 --- a/os_dep.c +++ b/os_dep.c @@ -3755,7 +3755,7 @@ static kern_return_t GC_forward_exception(mach_port_t thread, mach_port_t task, exception_behavior_t behavior; thread_state_flavor_t flavor; - thread_state_t thread_state = NULL; + thread_state_data_t thread_state; mach_msg_type_number_t thread_state_count = THREAD_STATE_MAX; for(i=0; i < GC_old_exc_ports.count; i++) @@ -3768,16 +3768,13 @@ static kern_return_t GC_forward_exception(mach_port_t thread, mach_port_t task, behavior = GC_old_exc_ports.behaviors[i]; flavor = GC_old_exc_ports.flavors[i]; - if(behavior != EXCEPTION_DEFAULT) { + if(behavior == EXCEPTION_STATE || behavior == EXCEPTION_STATE_IDENTITY) { r = thread_get_state(thread, flavor, thread_state, &thread_state_count); if(r != KERN_SUCCESS) ABORT("thread_get_state failed in forward_exception"); } switch(behavior) { - case EXCEPTION_DEFAULT: - r = exception_raise(port, thread, task, exception, data, data_count); - break; case EXCEPTION_STATE: r = exception_raise_state(port, thread, task, exception, data, data_count, &flavor, thread_state, thread_state_count, @@ -3789,13 +3786,12 @@ static kern_return_t GC_forward_exception(mach_port_t thread, mach_port_t task, thread_state_count, thread_state, &thread_state_count); break; - default: - r = KERN_FAILURE; /* make gcc happy */ - ABORT("forward_exception: unknown behavior"); - break; + /* case EXCEPTION_DEFAULT: */ /* default signal handlers */ + default: /* user-supplied signal handlers */ + r = exception_raise(port, thread, task, exception, data, data_count); } - if(behavior != EXCEPTION_DEFAULT) { + if(behavior == EXCEPTION_STATE || behavior == EXCEPTION_STATE_IDENTITY) { r = thread_set_state(thread, flavor, thread_state, thread_state_count); if(r != KERN_SUCCESS) ABORT("thread_set_state failed in forward_exception");