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.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2018-05-23 08:27:22 +09:00
parent c8fb7453fc
commit 14c21793a0
+1 -1
View File
@@ -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);
}