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:
539d3ad
)
interruptible FFI: more robust handling of the exception case in the interpreter
author
Simon Marlow
<marlowsd@gmail.com>
Sat, 25 Sep 2010 19:33:17 +0000
(19:33 +0000)
committer
Simon Marlow
<marlowsd@gmail.com>
Sat, 25 Sep 2010 19:33:17 +0000
(19:33 +0000)
rts/Interpreter.c
patch
|
blob
|
history
diff --git
a/rts/Interpreter.c
b/rts/Interpreter.c
index
58ffd25
..
fa4a46f
100644
(file)
--- 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;
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,
}
// Re-load the pointer to the BCO from the RET_DYN frame,