fixed processor_return_to

This commit is contained in:
hyunghwan.chung
2016-04-30 05:56:35 +00:00
parent 94717d197a
commit 77990a5172
3 changed files with 32 additions and 12 deletions

View File

@ -1839,9 +1839,14 @@ static int prim_processor_return_to (stix_t* stix, stix_ooi_t nargs)
if (rcv != (stix_oop_t)stix->processor) return 0;
/* TODO: check if ctx is a block context or a method context */
STIX_ASSERT (STIX_CLASSOF(stix, ctx) == stix->_block_context ||
STIX_CLASSOF(stix, ctx) == stix->_method_context);
ACTIVE_STACK_POPS (stix, nargs + 1); /* pop arguments and receiver */
SWITCH_ACTIVE_CONTEXT (stix, ctx);
ACTIVE_STACK_PUSH (stix, ret);
SWITCH_ACTIVE_CONTEXT (stix, (stix_oop_context_t)ctx);
return 1;
}