mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #890 from cremno/mrb_funcall--adjust-ci-and-sp-after-error
mrb_funcall_with_block: raised exception corrupts ci and stack
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user