diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-09-22 13:00:58 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2017-09-22 13:00:58 +0900 |
| commit | 0ceaa0960af0b0150bc16da3d10a5e1ab0d3053b (patch) | |
| tree | 5f3dd5bd624fe0b39e3038a2ec7fa936d70ee804 | |
| parent | 5760226e71e2dbf87d31d8aad2d0cdaa0a18748a (diff) | |
| download | mruby-0ceaa0960af0b0150bc16da3d10a5e1ab0d3053b.tar.gz mruby-0ceaa0960af0b0150bc16da3d10a5e1ab0d3053b.zip | |
`OP_EPOP` operand may be bigger than `mrb->c->eidx`; fix #3810
| -rw-r--r-- | src/vm.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1327,7 +1327,9 @@ RETRY_TRY_BLOCK: NEXT; } - for (n=0; n<a && mrb->c->eidx > epos; n++) { + if (a > mrb->c->eidx - epos) + a = mrb->c->eidx - epos; + for (n=0; n<a; n++) { proc = mrb->c->ensure[epos+n]; irep = proc->body.irep; ci = cipush(mrb); |
