diff options
| author | mlugg <mlugg@mlugg.co.uk> | 2025-09-08 14:32:02 +0100 |
|---|---|---|
| committer | mlugg <mlugg@mlugg.co.uk> | 2025-09-30 13:44:52 +0100 |
| commit | d9661e9e05af7a4be31c17cbfbbd8bc44d7c9000 (patch) | |
| tree | 3a13bbd3391f31707089ba5f3f54569fe131612f /src/Sema.zig | |
| parent | 3a561da38d42ba331eb67bdb7d86d4a3e9b74533 (diff) | |
| download | zig-d9661e9e05af7a4be31c17cbfbbd8bc44d7c9000.tar.gz zig-d9661e9e05af7a4be31c17cbfbbd8bc44d7c9000.zip | |
compiler: better crash handler
Far simpler, because everything which `crash_report.zig` did is now
handled pretty well by `std.debug` anyway. All we want is to print some
context around panics and segfaults. Using the new ability to override
the default segfault handler while still having std handle the
target-specific bits for us, that's really simple.
Diffstat (limited to 'src/Sema.zig')
| -rw-r--r-- | src/Sema.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Sema.zig b/src/Sema.zig index 73c5b13c21..81d7ed43cd 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -1130,8 +1130,8 @@ fn analyzeBodyInner( const tags = sema.code.instructions.items(.tag); const datas = sema.code.instructions.items(.data); - var crash_info = crash_report.prepAnalyzeBody(sema, block, body); - crash_info.push(); + var crash_info: crash_report.AnalyzeBody = undefined; + crash_info.push(sema, block, body); defer crash_info.pop(); // We use a while (true) loop here to avoid a redundant way of breaking out of @@ -2632,7 +2632,7 @@ pub fn failWithOwnedErrorMsg(sema: *Sema, block: ?*Block, err_msg: *Zcu.ErrorMsg std.debug.print("compile error during Sema:\n", .{}); var error_bundle = wip_errors.toOwnedBundle("") catch @panic("out of memory"); error_bundle.renderToStdErr(.{ .ttyconf = .no_color }); - crash_report.compilerPanic("unexpected compile error occurred", null); + std.debug.panicExtra(@returnAddress(), "unexpected compile error occurred", .{}); } if (block) |start_block| { |
