diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-02-04 12:37:08 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-02-04 12:37:08 +0900 |
| commit | 6e0ba0085d22b7751c46b178e841046483f0f6b4 (patch) | |
| tree | 6ad583814b2261224258cc198f6a466b82ce9efd | |
| parent | a746ebe96f28bb55e4fc10d70f9a0cc5c92affaa (diff) | |
| download | mruby-6e0ba0085d22b7751c46b178e841046483f0f6b4.tar.gz mruby-6e0ba0085d22b7751c46b178e841046483f0f6b4.zip | |
Jump address should fit in 16 bits range; fix #3426
| -rw-r--r-- | mrbgems/mruby-compiler/core/codegen.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mrbgems/mruby-compiler/core/codegen.c b/mrbgems/mruby-compiler/core/codegen.c index eae0492ce..1f7c069d4 100644 --- a/mrbgems/mruby-compiler/core/codegen.c +++ b/mrbgems/mruby-compiler/core/codegen.c @@ -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); } |
