diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-27 22:17:51 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2016-11-27 22:17:51 +0900 |
| commit | 36fc1f1431d9aa85c167f91ef30abe0953c56400 (patch) | |
| tree | b994a98cfaabf14ce40dc7167f608c169066b9ba /src | |
| parent | 5ea1bb0eea433a43dca22b34d051de2728bf5170 (diff) | |
| download | mruby-36fc1f1431d9aa85c167f91ef30abe0953c56400.tar.gz mruby-36fc1f1431d9aa85c167f91ef30abe0953c56400.zip | |
Added Exception check in mrb_exc_set(); close #3292
PR #3293 just checks for NoMethodError.
Diffstat (limited to 'src')
| -rw-r--r-- | src/error.c | 2 |
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); } } |
