From 694fab484805088030fa36efe3e6b6e7ee385852 Mon Sep 17 00:00:00 2001 From: Veikka Tuominen Date: Thu, 15 Sep 2022 00:43:48 +0300 Subject: std: add return address parameter to panic fn --- lib/std/debug.zig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/std/debug.zig') diff --git a/lib/std/debug.zig b/lib/std/debug.zig index a7f0b202cb..cfe646647b 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -284,13 +284,14 @@ pub fn assert(ok: bool) void { pub fn panic(comptime format: []const u8, args: anytype) noreturn { @setCold(true); - panicExtra(null, format, args); + panicExtra(null, null, format, args); } /// `panicExtra` is useful when you want to print out an `@errorReturnTrace` /// and also print out some values. pub fn panicExtra( trace: ?*std.builtin.StackTrace, + ret_addr: ?usize, comptime format: []const u8, args: anytype, ) noreturn { @@ -308,7 +309,7 @@ pub fn panicExtra( break :blk &buf; }, }; - std.builtin.panic(msg, trace); + std.builtin.panic(msg, trace, ret_addr); } /// Non-zero whenever the program triggered a panic. -- cgit v1.2.3