mrb_funcall_with_block: adj. ci & sp after error

see #894 / [ruby-talk:404969]
This commit is contained in:
Cremno
2013-02-26 02:41:32 +01:00
parent a3135e80af
commit 5de62ac23d
+5
View File
@@ -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();
}