Skip to content

Commit 146a9ee

Browse files
committed
Fix segfault on mrb_exc_backtrace.
The code to iterate over backtrace locations was changed in #3065, but unfortunately output_backtrace was not correctly updated to forward the callback.
1 parent f3cce24 commit 146a9ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/backtrace.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ output_backtrace_i(mrb_state *mrb, struct backtrace_location_raw *loc_raw, void
175175
static void
176176
output_backtrace(mrb_state *mrb, mrb_int ciidx, mrb_code *pc0, output_stream_func func, void *data)
177177
{
178-
each_backtrace(mrb, ciidx, pc0, output_backtrace_i, data);
178+
struct output_backtrace_args args;
179+
args.func = func;
180+
args.data = data;
181+
each_backtrace(mrb, ciidx, pc0, output_backtrace_i, &args);
179182
}
180183

181184
static void

0 commit comments

Comments
 (0)