Commit 3a6b6518 authored by Yukihiro Matsumoto's avatar Yukihiro Matsumoto

should handle exception from Ruby implemented method called from funcall; close #484

parent 72bcf7ee
......@@ -455,7 +455,6 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
int ai = mrb->arena_idx;
jmp_buf *prev_jmp = (jmp_buf *)mrb->jmp;
jmp_buf c_jmp;
ptrdiff_t ciidx = mrb->ci - mrb->cibase;
#ifdef DIRECT_THREADED
static void *optable[] = {
......@@ -1096,13 +1095,13 @@ mrb_run(mrb_state *mrb, struct RProc *proc, mrb_value self)
ci = mrb->ci;
eidx = mrb->ci->eidx;
if (ci == mrb->cibase) goto L_STOP;
if (ciidx == ci - mrb->cibase){
mrb->jmp = prev_jmp;
longjmp(*(jmp_buf*)mrb->jmp, 1);
}
while (ci[0].ridx == ci[-1].ridx) {
cipop(mrb);
ci = mrb->ci;
if (ci[1].acc < 0 && prev_jmp) {
mrb->jmp = prev_jmp;
longjmp(*(jmp_buf*)mrb->jmp, 1);
}
while (eidx > mrb->ci->eidx) {
ecall(mrb, --eidx);
}
......
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