Skip to content

Commit

Permalink
Merge pull request #142 from ElectrodeYT/fix-continue-1
Browse files Browse the repository at this point in the history
core/exec: Correctly pop loops when CONTINUE_OP is called
  • Loading branch information
qookei authored Feb 3, 2024
2 parents a228465 + 604042e commit 8cc0b53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2408,8 +2408,8 @@ static lai_api_error_t lai_exec_parse(int parse_mode, lai_state_t *state) {
lai_exec_pop_stack_back(state);
}

// Keep the LAI_LOOP_STACKITEM but reset the PC.
pc = loop_item->loop_pred;
// Set the PC of the block to its limit, to trigger a recheck of the predicate.
lai_exec_peek_blkstack_back(state)->pc = lai_exec_peek_blkstack_back(state)->limit;
break;
}
/* Break Loop */
Expand Down

0 comments on commit 8cc0b53

Please sign in to comment.