Added Exception check in mrb_exc_set(); close #3292

PR #3293 just checks for NoMethodError.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2016-11-27 22:17:51 +09:00
parent 5ea1bb0eea
commit 36fc1f1431
+2
View File
@@ -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);
}
}