Commit 5de62ac2 authored by Cremno's avatar Cremno

mrb_funcall_with_block: adj. ci & sp after error

see #894 / [ruby-talk:404969]
parent a3135e80
...@@ -316,8 +316,13 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr ...@@ -316,8 +316,13 @@ mrb_funcall_with_block(mrb_state *mrb, mrb_value self, mrb_sym mid, int argc, mr
if (!mrb->jmp) { if (!mrb->jmp) {
jmp_buf c_jmp; jmp_buf c_jmp;
mrb_callinfo *old_ci = mrb->ci;
if (setjmp(c_jmp) != 0) { /* error */ if (setjmp(c_jmp) != 0) { /* error */
while (old_ci != mrb->ci) {
mrb->stack = mrb->stbase + mrb->ci->stackidx;
cipop(mrb);
}
mrb->jmp = 0; mrb->jmp = 0;
return mrb_nil_value(); return mrb_nil_value();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment