| ... | ... | @@ -677,6 +677,13 @@ pub const panic: PanicFn = if (@hasDecl(root, "panic")) root.panic else default_ |
| 677 | 677 | /// therefore must be kept in sync with the compiler implementation. |
| 678 | 678 | pub fn default_panic(msg: []const u8, error_return_trace: ?*StackTrace) noreturn { |
| 679 | 679 | @setCold(true); |
| 680 | // Until self-hosted catches up with stage1 language features, we have a simpler |
| 681 | // default panic function: |
| 682 | if (builtin.zig_is_stage2) { |
| 683 | while (true) { |
| 684 | @breakpoint(); |
| 685 | } |
| 686 | } |
| 680 | 687 | if (@hasDecl(root, "os") and @hasDecl(root.os, "panic")) { |
| 681 | 688 | root.os.panic(msg, error_return_trace); |
| 682 | 689 | unreachable; |