mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
std.builtin.panic: simpler default panic for stage2
until it catches up to stage1 in terms of supported language features
This commit is contained in:
parent
298a65ff4b
commit
d481acc7db
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user