diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-02-26 23:31:38 -0800 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2013-02-26 23:31:38 -0800 |
| commit | 01274bcc4685a8adeacffa01e5ec5230bedc79ab (patch) | |
| tree | 6d4e61de0505806995a42e4aac364e8dd4cd9618 /src | |
| parent | dfafa59c0a79d77c1d00d5dd2ad29c5ab4c6a006 (diff) | |
| parent | 5de62ac23ddd35d027567aec9b7a023ed6698577 (diff) | |
| download | mruby-01274bcc4685a8adeacffa01e5ec5230bedc79ab.tar.gz mruby-01274bcc4685a8adeacffa01e5ec5230bedc79ab.zip | |
Merge pull request #890 from cremno/mrb_funcall--adjust-ci-and-sp-after-error
mrb_funcall_with_block: raised exception corrupts ci and stack
Diffstat (limited to 'src')
| -rw-r--r-- | src/vm.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -316,8 +316,13 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr if (!mrb->jmp) { jmp_buf c_jmp; + mrb_callinfo *old_ci = mrb->ci; if (setjmp(c_jmp) != 0) { /* error */ + while (old_ci != mrb->ci) { + mrb->stack = mrb->stbase + mrb->ci->stackidx; + cipop(mrb); + } mrb->jmp = 0; return mrb_nil_value(); } |
