]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/libsupc++/eh_personality.cc
Re-instate last patch...
[thirdparty/gcc.git] / libstdc++-v3 / libsupc++ / eh_personality.cc
index b7d957c4d3766101539cad58bc151dc2c5e22844..12b54c16587dfbf709da053b661a92a4f024aef6 100644 (file)
@@ -377,7 +377,7 @@ PERSONALITY_FUNCTION (int version,
   const unsigned char *p;
   _Unwind_Ptr landing_pad, ip;
   int handler_switch_value;
-  void* thrown_ptr = ue_header + 1;
+  void* thrown_ptr = 0;
   bool foreign_exception;
   int ip_before_insn = 0;
 
@@ -543,30 +543,33 @@ PERSONALITY_FUNCTION (int version,
       bool saw_handler = false;
 
 #ifdef __ARM_EABI_UNWINDER__
+      // ??? How does this work - more importantly, how does it interact with
+      // dependent exceptions?
       throw_type = ue_header;
       if (actions & _UA_FORCE_UNWIND)
        {
          __GXX_INIT_FORCED_UNWIND_CLASS(ue_header->exception_class);
-         thrown_ptr = 0;
        }
-      else if (foreign_exception)
-       thrown_ptr = 0;
+      else if (!foreign_exception)
+       thrown_ptr = __get_object_from_ue (ue_header);
 #else
       // During forced unwinding, match a magic exception type.
       if (actions & _UA_FORCE_UNWIND)
        {
          throw_type = &typeid(abi::__forced_unwind);
-         thrown_ptr = 0;
        }
       // With a foreign exception class, there's no exception type.
       // ??? What to do about GNU Java and GNU Ada exceptions?
       else if (foreign_exception)
        {
          throw_type = &typeid(abi::__foreign_exception);
-         thrown_ptr = 0;
        }
       else
-       throw_type = xh->exceptionType;
+        {
+          thrown_ptr = __get_object_from_ue (ue_header);
+          throw_type = __get_exception_header_from_obj
+            (thrown_ptr)->exceptionType;
+        }
 #endif
 
       while (1)
@@ -758,13 +761,14 @@ __cxa_call_unexpected (void *exc_obj_in)
 
       __cxa_eh_globals *globals = __cxa_get_globals_fast ();
       __cxa_exception *new_xh = globals->caughtExceptions;
-      void *new_ptr = new_xh + 1;
+      void *new_ptr = __get_object_from_ambiguous_exception (new_xh);
 
       // We don't quite have enough stuff cached; re-parse the LSDA.
       parse_lsda_header (0, xh_lsda, &info);
 
       // If this new exception meets the exception spec, allow it.
-      if (check_exception_spec (&info, new_xh->exceptionType,
+      if (check_exception_spec (&info, __get_exception_header_from_obj
+                                  (new_ptr)->exceptionType,
                                new_ptr, xh_switch_value))
        __throw_exception_again;