summaryrefslogtreecommitdiffhomepage
path: root/src/error.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2017-12-01 17:50:51 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2017-12-04 08:56:11 +0900
commitcd9f53d42eae3b57ebc5c75492dcf372a627f300 (patch)
treee4bdab623c7137900f9ae3341913a6a562b3fb63 /src/error.c
parentc35a4026767cfc11488fde2bc02ec84877dd6194 (diff)
downloadmruby-cd9f53d42eae3b57ebc5c75492dcf372a627f300.tar.gz
mruby-cd9f53d42eae3b57ebc5c75492dcf372a627f300.zip
Pop exception objects from the bottom of GC arena; fix #3863
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/error.c b/src/error.c
index a9b6db07a..411a15081 100644
--- a/src/error.c
+++ b/src/error.c
@@ -229,6 +229,9 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
}
else {
mrb->exc = mrb_obj_ptr(exc);
+ if ((struct RBasic*)mrb->exc == mrb->gc.arena[mrb->gc.arena_idx-1]) {
+ mrb->gc.arena_idx--;
+ }
if (!mrb->gc.out_of_memory) {
exc_debug_info(mrb, mrb->exc);
mrb_keep_backtrace(mrb, exc);