diff options
author | Viktor Dukhovni <ietf-dane@dukhovni.org> | 2021-01-02 01:00:51 -0500 |
---|---|---|
committer | Viktor Dukhovni <ietf-dane@dukhovni.org> | 2021-01-02 12:58:33 -0500 |
commit | a0dcdfd1c91e0b13b5f1bf4c5e49b9593414b1d6 (patch) | |
tree | 5203269c61f5f95cbb85f2b0133f0aca96ce6133 | |
parent | 5b62aa0d252bf7030230b0e81c5025253faef5f1 (diff) | |
download | haskell-a0dcdfd1c91e0b13b5f1bf4c5e49b9593414b1d6.tar.gz |
Maintain invariant: MVars on mut_list are dirty
The fix for 18919 was somewhat incomplete: while the MVars were
correctly added to the mut_list via dirty_MVAR(), their info table
remained "clean".
While this is mostly harmless in non-debug builds, it trips an
assertion in the debug build, and may result in the MVar being
needlessly being added to the mut_list multiple times.
Resolves: #19145
-rw-r--r-- | rts/PrimOps.cmm | 2 | ||||
-rw-r--r-- | rts/Threads.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 7f7565cfd9..6ce206f139 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1836,6 +1836,7 @@ loop: // Resolve #18919. ccall dirty_MVAR(BaseReg "ptr", mvar "ptr", StgMVar_value(mvar) "ptr"); + info = stg_MVAR_DIRTY_info; } } @@ -1926,6 +1927,7 @@ loop: // Resolve #18919. ccall dirty_MVAR(BaseReg "ptr", mvar "ptr", StgMVar_value(mvar) "ptr"); + info = stg_MVAR_DIRTY_info; } } diff --git a/rts/Threads.c b/rts/Threads.c index 39616655ab..2560a4d765 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -810,6 +810,7 @@ loop: if (info == &stg_MVAR_CLEAN_info) { // Resolve #18919. dirty_MVAR(&cap->r, (StgClosure*)mvar, mvar->value); + info = &stg_MVAR_DIRTY_info; } } |