summaryrefslogtreecommitdiff
path: root/rts/win32
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-04-20 12:21:25 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-04-20 12:21:25 +0000
commit870b59f53cb97904096bfd6ea0e58ffc055a14ea (patch)
tree08d13d098df4f1b7e49579aa4acbc9d83802f04c /rts/win32
parent5a252eb7bbbe655f63f65e012b8176fd1dd6953f (diff)
downloadhaskell-870b59f53cb97904096bfd6ea0e58ffc055a14ea.tar.gz
Fix crash in non-threaded RTS on Windows
The tso->block_info field is now overwritten by pushOnRunQueue(), but stg_block_async_info was assuming that it still held a pointer to the StgAsyncIOResult. We must therefore save this value somewhere safe before putting the TSO on the run queue.
Diffstat (limited to 'rts/win32')
-rw-r--r--rts/win32/AsyncIO.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rts/win32/AsyncIO.c b/rts/win32/AsyncIO.c
index 8662e2a369..5dedee0c70 100644
--- a/rts/win32/AsyncIO.c
+++ b/rts/win32/AsyncIO.c
@@ -313,6 +313,11 @@ start:
/* 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->sp[1] = (W_)tso->block_info.async_result;
pushOnRunQueue(&MainCapability, tso);
break;
}