diff -r -u -d druntime.orig/src/rt/deh2.d druntime2/src/rt/deh2.d
--- druntime.orig/src/rt/deh2.d	2010-06-27 18:32:45.073602298 +0200
+++ druntime2/src/rt/deh2.d	2010-06-27 18:59:15.035378477 +0200
@@ -142,172 +142,350 @@
  * Throw a D object.
  */
 
-extern (Windows) void _d_throw(Object *h)
+version(Windows)
 {
-    uint regebp;
-
-    debug
-    {
-        printf("_d_throw(h = %p, &h = %p)\n", h, &h);
-        printf("\tvptr = %p\n", *cast(void **)h);
-    }
-
-    asm
-    {
-        mov regebp,EBP  ;
-    }
-
-//static uint abc;
-//if (++abc == 2) *(char *)0=0;
-
-//int count = 0;
-    while (1)           // for each function on the stack
+    extern (Windows) void _d_throw(Object *h)
     {
-        DHandlerTable *handler_table;
-        FuncTable *pfunc;
-        DHandlerInfo *phi;
-        uint retaddr;
-        uint funcoffset;
-        uint spoff;
-        uint retoffset;
-        int index;
-        int dim;
-        int ndx;
-        int prev_ndx;
-
-        regebp = __eh_find_caller(regebp,&retaddr);
-        if (!regebp)
-        {   // if end of call chain
-            debug printf("end of call chain\n");
-            break;
-        }
-
-        debug printf("found caller, EBP = x%x, retaddr = x%x\n", regebp, retaddr);
-//if (++count == 12) *(char*)0=0;
-        handler_table = __eh_finddata(cast(void *)retaddr);   // find static data associated with function
-        if (!handler_table)         // if no static data
+        uint regebp;
+    
+        debug
         {
-            debug printf("no handler table\n");
-            continue;
+            printf("_d_throw(h = %p, &h = %p)\n", h, &h);
+            printf("\tvptr = %p\n", *cast(void **)h);
         }
-        funcoffset = cast(uint)handler_table.fptr;
-        spoff = handler_table.espoffset;
-        retoffset = handler_table.retoffset;
-
-        debug
+    
+        asm
         {
-            printf("retaddr = x%x\n",cast(uint)retaddr);
-            printf("regebp=x%04x, funcoffset=x%04x, spoff=x%x, retoffset=x%x\n",
-            regebp,funcoffset,spoff,retoffset);
+            mov regebp,EBP  ;
         }
-
-        // Find start index for retaddr in static data
-        dim = handler_table.nhandlers;
-
-        debug
+    
+    //static uint abc;
+    //if (++abc == 2) *(char *)0=0;
+    
+    //int count = 0;
+        while (1)           // for each function on the stack
         {
-            printf("handler_info[]:\n");
+            DHandlerTable *handler_table;
+            FuncTable *pfunc;
+            DHandlerInfo *phi;
+            uint retaddr;
+            uint funcoffset;
+            uint spoff;
+            uint retoffset;
+            int index;
+            int dim;
+            int ndx;
+            int prev_ndx;
+    
+            regebp = __eh_find_caller(regebp,&retaddr);
+            if (!regebp)
+            {   // if end of call chain
+                debug printf("end of call chain\n");
+                break;
+            }
+    
+            debug printf("found caller, EBP = x%x, retaddr = x%x\n", regebp, retaddr);
+    //if (++count == 12) *(char*)0=0;
+            handler_table = __eh_finddata(cast(void *)retaddr);   // find static data associated with function
+            if (!handler_table)         // if no static data
+            {
+                debug printf("no handler table\n");
+                continue;
+            }
+            funcoffset = cast(uint)handler_table.fptr;
+            spoff = handler_table.espoffset;
+            retoffset = handler_table.retoffset;
+    
+            debug
+            {
+                printf("retaddr = x%x\n",cast(uint)retaddr);
+                printf("regebp=x%04x, funcoffset=x%04x, spoff=x%x, retoffset=x%x\n",
+                regebp,funcoffset,spoff,retoffset);
+            }
+    
+            // Find start index for retaddr in static data
+            dim = handler_table.nhandlers;
+    
+            debug
+            {
+                printf("handler_info[]:\n");
+                for (int i = 0; i < dim; i++)
+                {
+                    phi = &handler_table.handler_info[i];
+                    printf("\t[%d]: offset = x%04x, endoffset = x%04x, prev_index = %d, cioffset = x%04x, finally_code = %x\n",
+                            i, phi.offset, phi.endoffset, phi.prev_index, phi.cioffset, phi.finally_code);
+                }
+            }
+    
+            index = -1;
             for (int i = 0; i < dim; i++)
             {
                 phi = &handler_table.handler_info[i];
-                printf("\t[%d]: offset = x%04x, endoffset = x%04x, prev_index = %d, cioffset = x%04x, finally_code = %x\n",
-                        i, phi.offset, phi.endoffset, phi.prev_index, phi.cioffset, phi.finally_code);
+    
+                debug printf("i = %d, phi.offset = %04x\n", i, funcoffset + phi.offset);
+                if (cast(uint)retaddr > funcoffset + phi.offset &&
+                    cast(uint)retaddr <= funcoffset + phi.endoffset)
+                    index = i;
+            }
+            debug printf("index = %d\n", index);
+    
+            // walk through handler table, checking each handler
+            // with an index smaller than the current table_index
+            for (ndx = index; ndx != -1; ndx = prev_ndx)
+            {
+                phi = &handler_table.handler_info[ndx];
+                prev_ndx = phi.prev_index;
+                if (phi.cioffset)
+                {
+                    // this is a catch handler (no finally)
+                    DCatchInfo *pci;
+                    int ncatches;
+                    int i;
+    
+                    pci = cast(DCatchInfo *)(cast(char *)handler_table + phi.cioffset);
+                    ncatches = pci.ncatches;
+                    for (i = 0; i < ncatches; i++)
+                    {
+                        DCatchBlock *pcb;
+                        ClassInfo ci = **cast(ClassInfo **)h;
+    
+                        pcb = &pci.catch_block[i];
+    
+                        if (_d_isbaseof(ci, pcb.type))
+                        {   // Matched the catch type, so we've found the handler.
+    
+                            // Initialize catch variable
+                            *cast(void **)(regebp + (pcb.bpoffset)) = h;
+    
+                            // Jump to catch block. Does not return.
+                            {
+                                uint catch_esp;
+                                fp_t catch_addr;
+    
+                                catch_addr = cast(fp_t)(pcb.code);
+                                catch_esp = regebp - handler_table.espoffset - fp_t.sizeof;
+                                asm
+                                {
+                                    mov     EAX,catch_esp   ;
+                                    mov     ECX,catch_addr  ;
+                                    mov     [EAX],ECX       ;
+                                    mov     EBP,regebp      ;
+                                    mov     ESP,EAX         ; // reset stack
+                                    ret                     ; // jump to catch block
+                                }
+                            }
+                        }
+                    }
+                }
+                else if (phi.finally_code)
+                {   // Call finally block
+                    // Note that it is unnecessary to adjust the ESP, as the finally block
+                    // accesses all items on the stack as relative to EBP.
+    
+                    void *blockaddr = phi.finally_code;
+    
+                    version (OSX)
+                    {
+                        asm
+                        {
+                            sub     ESP,4           ; // align stack to 16
+                            push    EBX             ;
+                            mov     EBX,blockaddr   ;
+                            push    EBP             ;
+                            mov     EBP,regebp      ;
+                            call    EBX             ;
+                            pop     EBP             ;
+                            pop     EBX             ;
+                            add     ESP,4           ;
+                        }
+                    }
+                    else
+                    {
+                        asm
+                        {
+                            push        EBX             ;
+                            mov         EBX,blockaddr   ;
+                            push        EBP             ;
+                            mov         EBP,regebp      ;
+                            call        EBX             ;
+                            pop         EBP             ;
+                            pop         EBX             ;
+                        }
+                    }
+                }
             }
         }
-
-        index = -1;
-        for (int i = 0; i < dim; i++)
+    }
+}
+else
+{
+    extern (C) void _d_throw(Object *h)
+    {
+        uint regebp;
+    
+        debug
         {
-            phi = &handler_table.handler_info[i];
-
-            debug printf("i = %d, phi.offset = %04x\n", i, funcoffset + phi.offset);
-            if (cast(uint)retaddr > funcoffset + phi.offset &&
-                cast(uint)retaddr <= funcoffset + phi.endoffset)
-                index = i;
+            printf("_d_throw(h = %p, &h = %p)\n", h, &h);
+            printf("\tvptr = %p\n", *cast(void **)h);
         }
-        debug printf("index = %d\n", index);
-
-        // walk through handler table, checking each handler
-        // with an index smaller than the current table_index
-        for (ndx = index; ndx != -1; ndx = prev_ndx)
+    
+        asm
         {
-            phi = &handler_table.handler_info[ndx];
-            prev_ndx = phi.prev_index;
-            if (phi.cioffset)
+            mov regebp,EBP  ;
+        }
+    
+    //static uint abc;
+    //if (++abc == 2) *(char *)0=0;
+    
+    //int count = 0;
+        while (1)           // for each function on the stack
+        {
+            DHandlerTable *handler_table;
+            FuncTable *pfunc;
+            DHandlerInfo *phi;
+            uint retaddr;
+            uint funcoffset;
+            uint spoff;
+            uint retoffset;
+            int index;
+            int dim;
+            int ndx;
+            int prev_ndx;
+    
+            regebp = __eh_find_caller(regebp,&retaddr);
+            if (!regebp)
+            {   // if end of call chain
+                debug printf("end of call chain\n");
+                break;
+            }
+    
+            debug printf("found caller, EBP = x%x, retaddr = x%x\n", regebp, retaddr);
+    //if (++count == 12) *(char*)0=0;
+            handler_table = __eh_finddata(cast(void *)retaddr);   // find static data associated with function
+            if (!handler_table)         // if no static data
             {
-                // this is a catch handler (no finally)
-                DCatchInfo *pci;
-                int ncatches;
-                int i;
-
-                pci = cast(DCatchInfo *)(cast(char *)handler_table + phi.cioffset);
-                ncatches = pci.ncatches;
-                for (i = 0; i < ncatches; i++)
+                debug printf("no handler table\n");
+                continue;
+            }
+            funcoffset = cast(uint)handler_table.fptr;
+            spoff = handler_table.espoffset;
+            retoffset = handler_table.retoffset;
+    
+            debug
+            {
+                printf("retaddr = x%x\n",cast(uint)retaddr);
+                printf("regebp=x%04x, funcoffset=x%04x, spoff=x%x, retoffset=x%x\n",
+                regebp,funcoffset,spoff,retoffset);
+            }
+    
+            // Find start index for retaddr in static data
+            dim = handler_table.nhandlers;
+    
+            debug
+            {
+                printf("handler_info[]:\n");
+                for (int i = 0; i < dim; i++)
                 {
-                    DCatchBlock *pcb;
-                    ClassInfo ci = **cast(ClassInfo **)h;
-
-                    pcb = &pci.catch_block[i];
-
-                    if (_d_isbaseof(ci, pcb.type))
-                    {   // Matched the catch type, so we've found the handler.
-
-                        // Initialize catch variable
-                        *cast(void **)(regebp + (pcb.bpoffset)) = h;
-
-                        // Jump to catch block. Does not return.
-                        {
-                            uint catch_esp;
-                            fp_t catch_addr;
-
-                            catch_addr = cast(fp_t)(pcb.code);
-                            catch_esp = regebp - handler_table.espoffset - fp_t.sizeof;
-                            asm
+                    phi = &handler_table.handler_info[i];
+                    printf("\t[%d]: offset = x%04x, endoffset = x%04x, prev_index = %d, cioffset = x%04x, finally_code = %x\n",
+                            i, phi.offset, phi.endoffset, phi.prev_index, phi.cioffset, phi.finally_code);
+                }
+            }
+    
+            index = -1;
+            for (int i = 0; i < dim; i++)
+            {
+                phi = &handler_table.handler_info[i];
+    
+                debug printf("i = %d, phi.offset = %04x\n", i, funcoffset + phi.offset);
+                if (cast(uint)retaddr > funcoffset + phi.offset &&
+                    cast(uint)retaddr <= funcoffset + phi.endoffset)
+                    index = i;
+            }
+            debug printf("index = %d\n", index);
+    
+            // walk through handler table, checking each handler
+            // with an index smaller than the current table_index
+            for (ndx = index; ndx != -1; ndx = prev_ndx)
+            {
+                phi = &handler_table.handler_info[ndx];
+                prev_ndx = phi.prev_index;
+                if (phi.cioffset)
+                {
+                    // this is a catch handler (no finally)
+                    DCatchInfo *pci;
+                    int ncatches;
+                    int i;
+    
+                    pci = cast(DCatchInfo *)(cast(char *)handler_table + phi.cioffset);
+                    ncatches = pci.ncatches;
+                    for (i = 0; i < ncatches; i++)
+                    {
+                        DCatchBlock *pcb;
+                        ClassInfo ci = **cast(ClassInfo **)h;
+    
+                        pcb = &pci.catch_block[i];
+    
+                        if (_d_isbaseof(ci, pcb.type))
+                        {   // Matched the catch type, so we've found the handler.
+    
+                            // Initialize catch variable
+                            *cast(void **)(regebp + (pcb.bpoffset)) = h;
+    
+                            // Jump to catch block. Does not return.
                             {
-                                mov     EAX,catch_esp   ;
-                                mov     ECX,catch_addr  ;
-                                mov     [EAX],ECX       ;
-                                mov     EBP,regebp      ;
-                                mov     ESP,EAX         ; // reset stack
-                                ret                     ; // jump to catch block
+                                uint catch_esp;
+                                fp_t catch_addr;
+    
+                                catch_addr = cast(fp_t)(pcb.code);
+                                catch_esp = regebp - handler_table.espoffset - fp_t.sizeof;
+                                asm
+                                {
+                                    mov     EAX,catch_esp   ;
+                                    mov     ECX,catch_addr  ;
+                                    mov     [EAX],ECX       ;
+                                    mov     EBP,regebp      ;
+                                    mov     ESP,EAX         ; // reset stack
+                                    ret                     ; // jump to catch block
+                                }
                             }
                         }
                     }
                 }
-            }
-            else if (phi.finally_code)
-            {   // Call finally block
-                // Note that it is unnecessary to adjust the ESP, as the finally block
-                // accesses all items on the stack as relative to EBP.
-
-                void *blockaddr = phi.finally_code;
-
-                version (OSX)
-                {
-                    asm
+                else if (phi.finally_code)
+                {   // Call finally block
+                    // Note that it is unnecessary to adjust the ESP, as the finally block
+                    // accesses all items on the stack as relative to EBP.
+    
+                    void *blockaddr = phi.finally_code;
+    
+                    version (OSX)
                     {
-                        sub     ESP,4           ; // align stack to 16
-                        push    EBX             ;
-                        mov     EBX,blockaddr   ;
-                        push    EBP             ;
-                        mov     EBP,regebp      ;
-                        call    EBX             ;
-                        pop     EBP             ;
-                        pop     EBX             ;
-                        add     ESP,4           ;
+                        asm
+                        {
+                            sub     ESP,4           ; // align stack to 16
+                            push    EBX             ;
+                            mov     EBX,blockaddr   ;
+                            push    EBP             ;
+                            mov     EBP,regebp      ;
+                            call    EBX             ;
+                            pop     EBP             ;
+                            pop     EBX             ;
+                            add     ESP,4           ;
+                        }
                     }
-                }
-                else
-                {
-                    asm
+                    else
                     {
-                        push        EBX             ;
-                        mov         EBX,blockaddr   ;
-                        push        EBP             ;
-                        mov         EBP,regebp      ;
-                        call        EBX             ;
-                        pop         EBP             ;
-                        pop         EBX             ;
+                        asm
+                        {
+                            push        EBX             ;
+                            mov         EBX,blockaddr   ;
+                            push        EBP             ;
+                            mov         EBP,regebp      ;
+                            call        EBX             ;
+                            pop         EBP             ;
+                            pop         EBX             ;
+                        }
                     }
                 }
             }
diff -r -u -d druntime.orig/src/rt/deh.c druntime2/src/rt/deh.c
--- druntime.orig/src/rt/deh.c	2010-06-27 18:32:45.254703009 +0200
+++ druntime2/src/rt/deh.c	2010-06-27 18:59:11.204544741 +0200
@@ -222,13 +222,27 @@
  * Throw a D object.
  */
 
-void __stdcall _d_throw(Object *h)
+version(Windows)
 {
-    //printf("_d_throw(h = %p, &h = %p)\n", h, &h);
-    //printf("\tvptr = %p\n", *(void **)h);
-    RaiseException(STATUS_DIGITAL_MARS_D_EXCEPTION,
-                   EXCEPTION_NONCONTINUABLE,
-                   1, (DWORD *)&h);
+    void __stdcall _d_throw(Object *h)
+    {
+        //printf("_d_throw(h = %p, &h = %p)\n", h, &h);
+        //printf("\tvptr = %p\n", *(void **)h);
+        RaiseException(STATUS_DIGITAL_MARS_D_EXCEPTION,
+                       EXCEPTION_NONCONTINUABLE,
+                       1, (DWORD *)&h);
+    }
+}
+else
+{
+    void _d_throw(Object *h)
+    {
+        //printf("_d_throw(h = %p, &h = %p)\n", h, &h);
+        //printf("\tvptr = %p\n", *(void **)h);
+        RaiseException(STATUS_DIGITAL_MARS_D_EXCEPTION,
+                       EXCEPTION_NONCONTINUABLE,
+                       1, (DWORD *)&h);
+    }
 }
 
 /***********************************
