Skip to content

Commit

Permalink
Added Exception check in mrb_exc_set(); close #3292
Browse files Browse the repository at this point in the history
PR #3293 just checks for NoMethodError.
  • Loading branch information
matz committed Nov 27, 2016
1 parent 5ea1bb0 commit 36fc1f1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 36fc1f1

Please sign in to comment.