aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorBenjamin Feng <contact@fengb.me>2019-11-19 20:55:55 -0600
committerBenjamin Feng <contact@fengb.me>2019-11-19 20:55:55 -0600
commit218f9ff34e94511489d42f41831bc249464ed853 (patch)
tree057a15b6189f3eb94c11d4626002586519a2dc31 /lib/std
parentb88bb93af3cf22f5a994100e037dbb4091144f0c (diff)
downloadzig-218f9ff34e94511489d42f41831bc249464ed853.tar.gz
zig-218f9ff34e94511489d42f41831bc249464ed853.zip
Work around WASI's nonexistent @returnAddress()
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/debug.zig3
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);
}