diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-12-15 15:38:42 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-12-15 15:38:42 -0800 |
| commit | 06f518b93ac6fd8b960f9b79a1add0a82b54216d (patch) | |
| tree | b1a37312fbdb54b05f3ddd15bb7803b8a82bdf0d /src | |
| parent | 882afdea20f344c2a3ed4842a6269fe2b8922493 (diff) | |
| parent | 87a392067a831dae3e4afdb23b99e13a6d424a3b (diff) | |
| download | mruby-06f518b93ac6fd8b960f9b79a1add0a82b54216d.tar.gz mruby-06f518b93ac6fd8b960f9b79a1add0a82b54216d.zip | |
Merge pull request #1608 from nanamiwang/vmcrash
Fixed callinfo buffer overflow while calling ensure handlers
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1287,10 +1287,12 @@ mrb_context_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int mrb->jmp = prev_jmp; mrb_longjmp(mrb); } - while (eidx > ci[-1].eidx) { - ecall(mrb, --eidx); + if (ci > mrb->c->cibase) { + while (eidx > ci[-1].eidx) { + ecall(mrb, --eidx); + } } - if (ci == mrb->c->cibase) { + else if (ci == mrb->c->cibase) { if (ci->ridx == 0) { regs = mrb->c->stack = mrb->c->stbase; goto L_STOP; |
