Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created July 9, 2014 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jnthn/90e65072fad8a978776f to your computer and use it in GitHub Desktop.
Save jnthn/90e65072fad8a978776f to your computer and use it in GitHub Desktop.
diff --git a/src/core/interp.c b/src/core/interp.c
index 7cea172..efe163e 100644
--- a/src/core/interp.c
+++ b/src/core/interp.c
@@ -4370,16 +4370,18 @@ void MVM_interp_run(MVMThreadContext *tc, void (*initial_invoke)(MVMThreadContex
GET_REG(cur_op, 4).o, GET_REG(cur_op, 6).o);
cur_op += 8;
goto NEXT;
- OP(sp_log):
- if (tc->cur_frame->spesh_log_idx >= 0) {
+ OP(sp_log): {
+ MVMint32 log_idx = tc->cur_frame->spesh_log_idx;
+ if (log_idx >= 0 && log_idx < MVM_SPESH_LOG_RUNS) {
MVM_ASSIGN_REF(tc, &(tc->cur_frame->static_info->common.header),
tc->cur_frame->spesh_log_slots[
- GET_UI16(cur_op, 2) * MVM_SPESH_LOG_RUNS + tc->cur_frame->spesh_log_idx
+ GET_UI16(cur_op, 2) * MVM_SPESH_LOG_RUNS + log_idx
],
GET_REG(cur_op, 0).o);
}
cur_op += 4;
goto NEXT;
+ }
OP(sp_osrfinalize): {
MVMSpeshCandidate *cand = tc->cur_frame->spesh_cand;
if (cand) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment