X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FInterpreter.c;h=1b2d7303edf2d3285910cdf47248ec8a9ddad4b8;hb=3db6d1b8f2272f27e947e5347268a576452a6e77;hp=d541dfc4094e8972e8a7de1c215fc07412eb98b7;hpb=a8c3a7ccaf3e1d820a7902a478948a55f5324f50;p=ghc-hetmet.git diff --git a/rts/Interpreter.c b/rts/Interpreter.c index d541dfc..1b2d730 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -1281,7 +1281,7 @@ run_BCO: // context switching: sometimes the scheduler can invoke // the interpreter with context_switch == 1, particularly // if the -C0 flag has been given on the cmd line. - if (context_switch) { + if (cap->context_switch) { Sp--; Sp[0] = (W_)&stg_enter_info; RETURN_TO_SCHEDULER(ThreadInterpret, ThreadYielding); } @@ -1422,7 +1422,7 @@ run_BCO: ffi_call(cif, fn, ret, argptrs); // And restart the thread again, popping the RET_DYN frame. - cap = (Capability *)((void *)((unsigned char*)resumeThread(tok) - sizeof(StgFunTable))); + cap = (Capability *)((void *)((unsigned char*)resumeThread(tok) - FIELD_OFFSET(Capability,r))); LOAD_STACK_POINTERS; // Re-load the pointer to the BCO from the RET_DYN frame,