diff options
author | Simon Marlow <marlowsd@gmail.com> | 2011-08-08 09:12:08 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2011-08-08 13:48:39 +0100 |
commit | 7ed0b20c0828fef0987aa7b3dea5d5190844338c (patch) | |
tree | 7d4ab38f92cca956c5774b751bbcda56b1f096a8 | |
parent | 31f15ef0f037ca5484e55f72b3226e4e2bfb5c29 (diff) | |
download | haskell-7ed0b20c0828fef0987aa7b3dea5d5190844338c.tar.gz |
fix #5381: the -debug RTS could crash with "internal error: MVAR_CLEAN
on mutable list" after a call to tryPutMVar#.
I don't think this leads to any problems without -debug.
-rw-r--r-- | rts/PrimOps.cmm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index e17c6fb3f8..bb4f73bbab 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1451,10 +1451,6 @@ stg_tryPutMVarzh info = GET_INFO(mvar); #endif - if (info == stg_MVAR_CLEAN_info) { - foreign "C" dirty_MVAR(BaseReg "ptr", mvar "ptr"); - } - if (StgMVar_value(mvar) != stg_END_TSO_QUEUE_closure) { #if defined(THREADED_RTS) unlockClosure(mvar, info); @@ -1462,6 +1458,10 @@ stg_tryPutMVarzh RET_N(0); } + if (info == stg_MVAR_CLEAN_info) { + foreign "C" dirty_MVAR(BaseReg "ptr", mvar "ptr"); + } + q = StgMVar_head(mvar); loop: if (q == stg_END_TSO_QUEUE_closure) { |