summaryrefslogtreecommitdiff
path: root/rts/Interpreter.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2010-09-25 19:33:17 +0000
committerSimon Marlow <marlowsd@gmail.com>2010-09-25 19:33:17 +0000
commit11fbcd763a9ab7b4135693c510b8bb4e4709a438 (patch)
treeef4ee2c2af8c6321483f52f0fb10b941481b7995 /rts/Interpreter.c
parent539d3adec64f51a3fb13bb65b7a494d7eded01a0 (diff)
downloadhaskell-11fbcd763a9ab7b4135693c510b8bb4e4709a438.tar.gz
interruptible FFI: more robust handling of the exception case in the interpreter
Diffstat (limited to 'rts/Interpreter.c')
-rw-r--r--rts/Interpreter.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/rts/Interpreter.c b/rts/Interpreter.c
index 58ffd257af..fa4a46fd12 100644
--- a/rts/Interpreter.c
+++ b/rts/Interpreter.c
@@ -1454,11 +1454,12 @@ run_BCO:
cap = (Capability *)((void *)((unsigned char*)resumeThread(tok) - STG_FIELD_OFFSET(Capability,r)));
LOAD_STACK_POINTERS;
- if (Sp[0] == (W_)&stg_enter_info) {
- // Sp got clobbered due to an exception; so we should
- // go run it instead.
- Sp++;
- goto eval;
+ if (Sp[0] != (W_)&stg_gc_gen_info) {
+ // the stack is not how we left it. This probably
+ // means that an exception got raised on exit from the
+ // foreign call, so we should just continue with
+ // whatever is on top of the stack now.
+ RETURN_TO_SCHEDULER_NO_PAUSE(ThreadRunGHC, ThreadYielding);
}
// Re-load the pointer to the BCO from the RET_DYN frame,