]> granicus.if.org Git - gc/commitdiff
2009-09-15 Hans Boehm <Hans.Boehm@hp.com> (Mostly Juan Jose Garcia-Ripoll)
authorhboehm <hboehm>
Tue, 15 Sep 2009 18:24:57 +0000 (18:24 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:46 +0000 (21:06 +0400)
(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)

ChangeLog
os_dep.c

index 4e56a03191e6c939732e4ce2784eef888164f40b..004d645bdd3379137e25c67705298a6918242c3b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-15 Hans Boehm <Hans.Boehm@hp.com> (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 <ivmai@mail.ru>
        (ivmai137v2.diff)
index 3cc6d4977be1e2f3fd1dfea5b7263b058704689a..6aaaa10a3a8f66f95edd744957f4c40550342b81 100644 (file)
--- 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");