projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
866316b
)
addition to "Eagerly raise a blocked exception" to fix unreg case
author
Simon Marlow
<simonmar@microsoft.com>
Wed, 17 Jan 2007 09:59:44 +0000
(09:59 +0000)
committer
Simon Marlow
<simonmar@microsoft.com>
Wed, 17 Jan 2007 09:59:44 +0000
(09:59 +0000)
rts/Exception.cmm
patch
|
blob
|
history
diff --git
a/rts/Exception.cmm
b/rts/Exception.cmm
index
bf5893e
..
a3f3dd0
100644
(file)
--- a/
rts/Exception.cmm
+++ b/
rts/Exception.cmm
@@
-68,6
+68,16
@@
INFO_TABLE_RET( stg_unblockAsyncExceptionszh_ret,
* we are about to raise an async exception in the current
* thread, which might result in the thread being killed.
*/
* we are about to raise an async exception in the current
* thread, which might result in the thread being killed.
*/
+
+#ifndef REG_R1
+ /*
+ * raiseAsync assumes that the stack is in ThreadRunGHC state,
+ * i.e. with a return address on the top. In unreg mode, the
+ * return value for IO is on top of the return address, so we
+ * need to make a small adjustment here.
+ */
+ Sp_adj(1);
+#endif
SAVE_THREAD_STATE();
r = foreign "C" maybePerformBlockedException (MyCapability() "ptr",
CurrentTSO "ptr") [R1];
SAVE_THREAD_STATE();
r = foreign "C" maybePerformBlockedException (MyCapability() "ptr",
CurrentTSO "ptr") [R1];
@@
-82,6
+92,15
@@
INFO_TABLE_RET( stg_unblockAsyncExceptionszh_ret,
jump %ENTRY_CODE(Sp(0));
}
}
jump %ENTRY_CODE(Sp(0));
}
}
+#ifndef REG_R1
+ /*
+ * Readjust stack in unregisterised mode if we didn't raise an
+ * exception, see above
+ */
+ else {
+ Sp_adj(-1);
+ }
+#endif
}
#ifdef REG_R1
}
#ifdef REG_R1