mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
should handle exception from Ruby implemented method called from funcall; close #484
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user