diff options
| author | Benjamin Feng <contact@fengb.me> | 2019-11-19 20:55:55 -0600 |
|---|---|---|
| committer | Benjamin Feng <contact@fengb.me> | 2019-11-19 20:55:55 -0600 |
| commit | 218f9ff34e94511489d42f41831bc249464ed853 (patch) | |
| tree | 057a15b6189f3eb94c11d4626002586519a2dc31 /lib/std | |
| parent | b88bb93af3cf22f5a994100e037dbb4091144f0c (diff) | |
| download | zig-218f9ff34e94511489d42f41831bc249464ed853.tar.gz zig-218f9ff34e94511489d42f41831bc249464ed853.zip | |
Work around WASI's nonexistent @returnAddress()
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/debug.zig | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 3cf4306ea5..86d6522247 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -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); } |
