[project @ 2005-11-30 16:56:51 by simonmar]
authorsimonmar <unknown>
Wed, 30 Nov 2005 16:56:51 +0000 (16:56 +0000)
committersimonmar <unknown>
Wed, 30 Nov 2005 16:56:51 +0000 (16:56 +0000)
fix bug in the case of an uncaught exception

ghc/rts/Exception.cmm

index 3fdfdfd..dc6305c 100644 (file)
@@ -384,7 +384,11 @@ retry_pop_stack:
        Sp(0) = R1;             /* save the exception */
        StgTSO_what_next(CurrentTSO) = ThreadKilled::I16;
        SAVE_THREAD_STATE();    /* inline! */
-       R1 = ThreadFinished;
+
+       /* The return code goes in BaseReg->rRet, and BaseReg is returned in R1 */
+       StgRegTable_rRet(BaseReg) = ThreadFinished;
+       R1 = BaseReg;
+
        jump StgReturn;
     }