Permalink
Browse files

Avoid using `mrb_raise()` in `mrb_vm_exec()`; ref #3660

  • Loading branch information...
matz committed May 25, 2017
1 parent 3ef97e3 commit ff46957ef072832a3445c39c73b4a8eadceb5ce3
Showing with 8 additions and 2 deletions.
  1. +8 −2 src/vm.c
View
@@ -1148,8 +1148,14 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
case MRB_TT_MODULE:
break;
default:
mrb_raise(mrb, E_TYPE_ERROR, "class or module required for rescue clause");
break;
{
mrb_value exc;
exc = mrb_exc_new_str_lit(mrb, E_TYPE_ERROR,
"class or module required for rescue clause");
mrb_exc_set(mrb, exc);
goto L_RAISE;
}
}
ec = mrb_class_ptr(e);
regs[b] = mrb_bool_value(mrb_obj_is_kind_of(mrb, exc, ec));

0 comments on commit ff46957

Please sign in to comment.