diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-05-23 08:27:22 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-05-23 08:30:50 +0900 |
| commit | 14c21793a01e4caa802e600540628fe9ae622d54 (patch) | |
| tree | a3783597b6202ba1cf3d535d16dda37066bf3c1b /src | |
| parent | c8fb7453fc50887c23e1fa567dd785003987ec48 (diff) | |
| download | mruby-14c21793a01e4caa802e600540628fe9ae622d54.tar.gz mruby-14c21793a01e4caa802e600540628fe9ae622d54.zip | |
Check if the exception is frozen; fix #4025
`exc_debug_info()` and `mrb_keep_backtrace()` raise `FrozenError`
if the exception is frozen and lead to infinite loop.
Diffstat (limited to 'src')
| -rw-r--r-- | src/error.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/error.c b/src/error.c index 5445b51bf..599612b97 100644 --- a/src/error.c +++ b/src/error.c @@ -233,7 +233,7 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc) (struct RBasic*)mrb->exc == mrb->gc.arena[mrb->gc.arena_idx-1]) { mrb->gc.arena_idx--; } - if (!mrb->gc.out_of_memory) { + if (!mrb->gc.out_of_memory && !MRB_FROZEN_P(mrb->exc)) { exc_debug_info(mrb, mrb->exc); mrb_keep_backtrace(mrb, exc); } |
