summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/error.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/error.c b/src/error.c
index 13032b136..9ff570bf6 100644
--- a/src/error.c
+++ b/src/error.c
@@ -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);
}
}