From 14c21793a01e4caa802e600540628fe9ae622d54 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 23 May 2018 08:27:22 +0900 Subject: 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. --- src/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/error.c') 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); } -- cgit v1.2.3