mirror of
https://github.com/ziglang/zig.git
synced 2026-02-21 16:54:52 +00:00
Work around WASI's nonexistent @returnAddress()
This commit is contained in:
parent
b88bb93af3
commit
218f9ff34e
@ -213,7 +213,8 @@ pub fn assert(ok: bool) void {
|
||||
|
||||
pub fn panic(comptime format: []const u8, args: ...) noreturn {
|
||||
@setCold(true);
|
||||
const first_trace_addr = @returnAddress();
|
||||
// TODO: remove conditional once wasi / LLVM defines __builtin_return_address
|
||||
const first_trace_addr = if (builtin.os == .wasi) null else @returnAddress();
|
||||
panicExtra(null, first_trace_addr, format, args);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user