[commit: ghc] master: Fix bug in stg_enter_checkbh (225172e)

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/225172e68980ce948e2fd00aa2d8a81657207525

>---------------------------------------------------------------

commit 225172e68980ce948e2fd00aa2d8a81657207525
Author: Simon Marlow <[email protected]>
Date:   Thu Nov 1 13:02:57 2012 +0000

    Fix bug in stg_enter_checkbh
    
    This was causing crashes in stm050(ghci), throwto001(ghci), and
    possibly more.

>---------------------------------------------------------------

 rts/HeapStackCheck.cmm |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/rts/HeapStackCheck.cmm b/rts/HeapStackCheck.cmm
index b3ae264..fbceb76 100644
--- a/rts/HeapStackCheck.cmm
+++ b/rts/HeapStackCheck.cmm
@@ -221,7 +221,11 @@ INFO_TABLE_RET ( stg_enter_checkbh, RET_SMALL,
 {
     foreign "C" checkBlockingQueues(MyCapability() "ptr",
                                     CurrentTSO);
-    return (updatee);
+
+    // we need to return updatee now.  Note that it might be a pointer
+    // to an indirection or a tagged value, we don't know which, so we
+    // need to ENTER() rather than return().
+    ENTER(updatee);
 }
 
 /* -----------------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.