diff tango/lib/compiler/llvmdc/eh.d @ 319:e9c93739bc4c trunk

[svn r340] Rework exception handling to work with nested tryfinally and trycatch.
author ChristianK
date Sat, 05 Jul 2008 10:22:56 +0200
parents 8e570dbe4087
children 5bea8a1ef905
line wrap: on
line diff
--- a/tango/lib/compiler/llvmdc/eh.d	Fri Jul 04 09:00:49 2008 +0200
+++ b/tango/lib/compiler/llvmdc/eh.d	Sat Jul 05 10:22:56 2008 +0200
@@ -4,7 +4,7 @@
 
 import util.console;
 
-//debug = EH_personality;
+// debug = EH_personality;
 
 private extern(C) void abort();
 private extern(C) int printf(char*, ...);
@@ -251,6 +251,7 @@
 
   else if(actions & _Unwind_Action.HANDLER_PHASE)
   {
+    debug(EH_personality) printf("Setting switch value to: %d!\n", switchval);
     _Unwind_SetGR(context, eh_exception_regno, cast(ulong)cast(void*)(exception_struct.exception_object));
     _Unwind_SetGR(context, eh_selector_regno, switchval);
     _Unwind_SetIP(context, landing_pad);
@@ -269,6 +270,7 @@
   debug(EH_personality) printf("Calling cleanup routine...\n");
 
   _Unwind_SetGR(context, eh_exception_regno, cast(ulong)exception_struct);
+  _Unwind_SetGR(context, eh_selector_regno, 0);
   _Unwind_SetIP(context, landing_pad);
   return _Unwind_Reason_Code.INSTALL_CONTEXT;
 }