From 870b59f53cb97904096bfd6ea0e58ffc055a14ea Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 20 Apr 2010 12:21:25 +0000 Subject: 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. --- rts/win32/AsyncIO.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'rts/win32/AsyncIO.c') 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; } -- cgit v1.2.1