Commit 01274bcc authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #890 from cremno/mrb_funcall--adjust-ci-and-sp-after-error

mrb_funcall_with_block: raised exception corrupts ci and stack
parents dfafa59c 5de62ac2
......@@ -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();
}
......
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