| author | |
| committer | |
| log | db8c0744767b3d472f9682827a312a8ffed74adf |
| tree | bc3c246a0f2bad79600970a20bcfd98bc42e7e12 |
| parent | 1b491e640d7c6a3cd71c4b146ca104ff0b136edd |
3 files changed, 5 insertions(+), 4 deletions(-)
lib/std/builtin.zig+1-1| ... | ... | @@ -770,7 +770,7 @@ pub const panic: PanicFn = if (@hasDecl(root, "panic")) |
| 770 | 770 | else if (@hasDecl(root, "os") and @hasDecl(root.os, "panic")) |
| 771 | 771 | root.os.panic |
| 772 | 772 | else |
| 773 | std.debug.defaultPanic; | |
| 773 | Panic.call; | |
| 774 | 774 | |
| 775 | 775 | /// This namespace is used by the Zig compiler to emit various kinds of safety |
| 776 | 776 | /// panics. These can be overridden by making a public `Panic` namespace in the |
src/Sema.zig+1-1| ... | ... | @@ -27639,7 +27639,7 @@ fn prepareSimplePanic(sema: *Sema, block: *Block, src: LazySrcLoc) !void { |
| 27639 | 27639 | const zcu = pt.zcu; |
| 27640 | 27640 | |
| 27641 | 27641 | if (zcu.panic_func_index == .none) { |
| 27642 | const fn_ref = try sema.analyzeNavVal(block, src, try pt.getBuiltinNav("panic")); | |
| 27642 | const fn_ref = try sema.getBuiltinInnerAsInst(block, src, "Panic", "call"); | |
| 27643 | 27643 | const fn_val = try sema.resolveConstValue(block, src, fn_ref, .{ |
| 27644 | 27644 | .needed_comptime_reason = "panic handler must be comptime-known", |
| 27645 | 27645 | }); |
src/Zcu.zig+3-2| ... | ... | @@ -2918,8 +2918,9 @@ pub fn addGlobalAssembly(zcu: *Zcu, cau: InternPool.Cau.Index, source: []const u |
| 2918 | 2918 | } |
| 2919 | 2919 | |
| 2920 | 2920 | pub const Feature = enum { |
| 2921 | /// When this feature is enabled, Sema will emit calls to `std.builtin.panic` | |
| 2922 | /// for things like safety checks and unreachables. Otherwise traps will be emitted. | |
| 2921 | /// When this feature is enabled, Sema will emit calls to | |
| 2922 | /// `std.builtin.Panic` functions for things like safety checks and | |
| 2923 | /// unreachables. Otherwise traps will be emitted. | |
| 2923 | 2924 | panic_fn, |
| 2924 | 2925 | /// When this feature is enabled, Sema will insert tracer functions for gathering a stack |
| 2925 | 2926 | /// trace for error returns. |