aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-07-07 00:38:46 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-07-07 00:38:46 -0700
commitd481acc7dbebb5501b5fef608ee1f6b13c442c6a (patch)
tree6d2a9778ce43f1a45be1133c4ed776629c7c1128
parent298a65ff4b4efc46c877309be22550f023f49758 (diff)
downloadzig-d481acc7dbebb5501b5fef608ee1f6b13c442c6a.tar.gz
zig-d481acc7dbebb5501b5fef608ee1f6b13c442c6a.zip
std.builtin.panic: simpler default panic for stage2
until it catches up to stage1 in terms of supported language features
-rw-r--r--lib/std/builtin.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/std/builtin.zig b/lib/std/builtin.zig
index 7bf60f5283..9d432a3a00 100644
--- a/lib/std/builtin.zig
+++ b/lib/std/builtin.zig
@@ -677,6 +677,13 @@ pub const panic: PanicFn = if (@hasDecl(root, "panic")) root.panic else default_
/// therefore must be kept in sync with the compiler implementation.
pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace) noreturn {
@setCold(true);
+ // Until self-hosted catches up with stage1 language features, we have a simpler
+ // default panic function:
+ if (builtin.zig_is_stage2) {
+ while (true) {
+ @breakpoint();
+ }
+ }
if (@hasDecl(root, "os") and @hasDecl(root.os, "panic")) {
root.os.panic(msg, error_return_trace);
unreachable;