mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
std.debug: fix ConfigurableTrace.dump OOB
The for-loop in dump() would index out of bounds if `t.index` is greater than size, because `end` is the maximum of `t.index` and `size` rather than the minimum.
This commit is contained in:
parent
6de0c622ff
commit
87d8cb19e4
@ -1999,7 +1999,7 @@ pub fn ConfigurableTrace(comptime size: usize, comptime stack_frame_count: usize
|
||||
|
||||
const tty_config = detectTTYConfig();
|
||||
const stderr = io.getStdErr().writer();
|
||||
const end = @maximum(t.index, size);
|
||||
const end = @minimum(t.index, size);
|
||||
const debug_info = getSelfDebugInfo() catch |err| {
|
||||
stderr.print(
|
||||
"Unable to dump stack trace: Unable to open debug info: {s}\n",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user