From d6cbe1bfc6bb7b21cc779dd48aa042b71c8c94dc Mon Sep 17 00:00:00 2001 From: Carlo Prelz Date: Fri, 26 Feb 2016 09:21:33 +0100 Subject: The original code crashed when mrb->backtrace.n grew to 16. It looks like the logic to reallocate the backtrace was flawed, based on the wrong variable (loc_raw->i, which, as I have verified, decreases from 16 to 0 instead of increasing) I am not sure if this is the correct fix --- src/backtrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backtrace.c b/src/backtrace.c index 2fce6645d..45a8cc2de 100644 --- a/src/backtrace.c +++ b/src/backtrace.c @@ -330,7 +330,7 @@ save_backtrace_i(mrb_state *mrb, { mrb_backtrace_entry *entry; - if (loc_raw->i >= mrb->backtrace.n_allocated) { + if (mrb->backtrace.n >= mrb->backtrace.n_allocated) { int new_n_allocated; if (mrb->backtrace.n_allocated == 0) { new_n_allocated = 8; -- cgit v1.2.3