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.
parent c8fb7453
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment