X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FInterpreter.c;h=fa4a46fd1277b72ba1be4ced6e872285b71e0156;hb=7267a7862cc406e593c89e79a4d5ab064ac40120;hp=da7ee2196aace39fc16e7335575ded68e69e6ce8;hpb=83d563cb9ede0ba792836e529b1e2929db926355;p=ghc-hetmet.git diff --git a/rts/Interpreter.c b/rts/Interpreter.c index da7ee21..fa4a46f 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -1454,6 +1454,14 @@ run_BCO: cap = (Capability *)((void *)((unsigned char*)resumeThread(tok) - STG_FIELD_OFFSET(Capability,r))); LOAD_STACK_POINTERS; + 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, // it might have moved during the call. Also reload the // pointers to the components of the BCO.