+2005-08-13 Marcin Koziej <creep@desk.pl>
+ Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR libobjc/22492
+ * execute/exceptions/finally-1.m: New test.
+
2005-08-13 Andrew Pinski <pinskia@physics.uc.edu>
* objc.dg/nested-func-1.m: Move to ...
--- /dev/null
+#include <objc/Object.h>
+
+int
+thrower_try_body()
+{
+ printf("Thrower try body\n");
+ return (0);
+}
+
+int
+finally_body()
+{
+ printf("Finally body\n");
+ return (0);
+}
+
+int
+thrower()
+{
+ @try
+ {
+ thrower_try_body();
+ @throw [Object new];
+ }
+ @finally
+ {
+ finally_body();
+ } // <----- program aborts here.
+ return 0;
+}
+
+
+int
+main(int ac, char *av[])
+{
+ @try
+ {
+ thrower();
+ }
+ @catch (id exc)
+ {
+ printf("Got exception of class %s\n", [[exc class] name]);
+ [exc free];
+ }
+}
+2005-08-13 Marcin Koziej <creep@desk.pl>
+ Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR libobjc/22492
+ * exception.c (PERSONALITY_FUNCTION): Fix the PC with finally.
+
2005-08-13 Andrew Pinski <pinskia@physics.uc.edu>
* Makefile.in (extra_ldflags_libobjc): New.
const unsigned char *p;
_Unwind_Ptr landing_pad, ip;
int handler_switch_value;
- int saw_cleanup, saw_handler;
+ int saw_cleanup = 0, saw_handler;
+ void *return_object;
/* Interface version check. */
if (version != 1)
}
install_context:
+ if (saw_cleanup == 0)
+ {
+ return_object = xh->value;
+ if (!(actions & _UA_SEARCH_PHASE))
+ _Unwind_DeleteException(&xh->base);
+ }
+
_Unwind_SetGR (context, __builtin_eh_return_data_regno (0),
- __builtin_extend_pointer (xh->value));
+ __builtin_extend_pointer (saw_cleanup ? xh : return_object));
_Unwind_SetGR (context, __builtin_eh_return_data_regno (1),
handler_switch_value);
_Unwind_SetIP (context, landing_pad);