From bbf21853b40dbc8dba0c00a8b47af7308ea94ee9 Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Thu, 22 Jan 2009 17:50:38 +0100 Subject: [PATCH] Fix x86-64 exception handling #180. Thanks pcwalton! --- runtime/internal/eh.d | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runtime/internal/eh.d b/runtime/internal/eh.d index 43c39a6c9d..2ce4048075 100644 --- a/runtime/internal/eh.d +++ b/runtime/internal/eh.d @@ -302,10 +302,12 @@ extern(C) _Unwind_Reason_Code _d_eh_personality(int ver, _Unwind_Action actions, // These are the register numbers for SetGR that // llvm's eh.exception and eh.selector intrinsics // will pick up. -// Found by trial-and-error :/ +// Hints for these can be found by looking at the +// EH_RETURN_DATA_REGNO macro in GCC, careful testing +// is required though. version (X86_64) { - private int eh_exception_regno = 3; + private int eh_exception_regno = 0; private int eh_selector_regno = 1; } else { private int eh_exception_regno = 0;