Skip to content

Commit

Permalink
Detect frame change in extop call.
Browse files Browse the repository at this point in the history
This means we'll be able to remove the nasty cur_op fiddling in the
Rakudo ext-ops that invoke.
  • Loading branch information
jnthn committed Jul 25, 2014
1 parent 895bcc8 commit 6753df5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/core/interp.c
Original file line number Diff line number Diff line change
Expand Up @@ -4681,21 +4681,23 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
#if MVM_CGOTO
OP_CALL_EXTOP: {
/* Bounds checking? Never heard of that. */
MVMFrame *frame_before = tc->cur_frame;
MVMExtOpRecord *record = &cu->body.extops[op - MVM_OP_EXT_BASE];

record->func(tc);
cur_op += record->operand_bytes;
if (tc->cur_frame == frame_before)
cur_op += record->operand_bytes;
goto NEXT;
}
#else
default: {
if (op >= MVM_OP_EXT_BASE
&& (op - MVM_OP_EXT_BASE) < cu->body.num_extops) {
MVMFrame *frame_before = tc->cur_frame;
MVMExtOpRecord *record =
&cu->body.extops[op - MVM_OP_EXT_BASE];

record->func(tc);
cur_op += record->operand_bytes;
if (tc->cur_frame == frame_before)
cur_op += record->operand_bytes;
goto NEXT;
}

Expand Down

0 comments on commit 6753df5

Please sign in to comment.