diff options
author | Ben Gamari <ben@smart-cactus.org> | 2023-04-28 08:55:02 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2023-05-16 08:07:57 -0400 |
commit | c8f74d5f6e9874424c1e55f586ff44568308a94c (patch) | |
tree | 2ff63bdd0dd80b4f7eed738a46ba129b06b65152 /rts/win32/AsyncMIO.c | |
parent | 1e6861dd8612d8f71cc4635c4f73f84f316a6c7e (diff) | |
download | haskell-wip/clear-block-info.tar.gz |
rts: Clear block_info when unblockingwip/clear-block-info
Otherwise we may end up with dangling pointers which may complicate
debugging. Also, introduce more strict checking of block_info in
checkTSO.
Diffstat (limited to 'rts/win32/AsyncMIO.c')
-rw-r--r-- | rts/win32/AsyncMIO.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rts/win32/AsyncMIO.c b/rts/win32/AsyncMIO.c index 00d1638d63..6230512eeb 100644 --- a/rts/win32/AsyncMIO.c +++ b/rts/win32/AsyncMIO.c @@ -318,14 +318,16 @@ start: : END_TSO_QUEUE; } - // Terminates the run queue + this inner for-loop. - tso->_link = END_TSO_QUEUE; - tso->why_blocked = NotBlocked; // save the StgAsyncIOResult in the // stg_block_async_info stack frame, because // the block_info field will be overwritten by // pushOnRunQueue(). tso->stackobj->sp[1] = (W_)tso->block_info.async_result; + + tso->why_blocked = NotBlocked; + tso->block_info.closure = (StgClosure *)END_TSO_QUEUE; + // Terminates the run queue + this inner for-loop. + tso->_link = END_TSO_QUEUE; pushOnRunQueue(&MainCapability, tso); break; } |