mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Added Exception check in mrb_exc_set(); close #3292
PR #3293 just checks for NoMethodError.
This commit is contained in:
@@ -278,6 +278,8 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
|
||||
mrb->exc = 0;
|
||||
}
|
||||
else {
|
||||
if (!mrb_obj_is_kind_of(mrb, exc, mrb->eException_class))
|
||||
mrb_raise(mrb, E_TYPE_ERROR, "exception object expected");
|
||||
mrb->exc = mrb_obj_ptr(exc);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user