Skip to content

Commit

Permalink
Jump address should fit in 16 bits range; fix #3426
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Feb 4, 2017
1 parent a746ebe commit 6e0ba00
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mrbgems/mruby-compiler/core/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ dispatch(codegen_scope *s, int pc)
scope_error(s);
break;
}
if (diff > MAXARG_sBx) {
codegen_error(s, "too distant jump address");
}
s->iseq[pc] = MKOP_AsBx(c, GETARG_A(i), diff);
}

Expand Down

0 comments on commit 6e0ba00

Please sign in to comment.