diff options
Diffstat (limited to 'src/crash_report.zig')
| -rw-r--r-- | src/crash_report.zig | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/crash_report.zig b/src/crash_report.zig index d4e4b46a53..2b33bd7fa5 100644 --- a/src/crash_report.zig +++ b/src/crash_report.zig @@ -139,18 +139,22 @@ fn dumpStatusReport() !void { var crash_heap: [16 * 4096]u8 = undefined; -fn writeFilePath(file: *Module.File, stream: anytype) !void { - if (file.pkg.root_src_directory.path) |path| { - try stream.writeAll(path); - try stream.writeAll(std.fs.path.sep_str); +fn writeFilePath(file: *Module.File, writer: anytype) !void { + if (file.mod.root.root_dir.path) |path| { + try writer.writeAll(path); + try writer.writeAll(std.fs.path.sep_str); } - try stream.writeAll(file.sub_file_path); + if (file.mod.root.sub_path.len > 0) { + try writer.writeAll(file.mod.root.sub_path); + try writer.writeAll(std.fs.path.sep_str); + } + try writer.writeAll(file.sub_file_path); } -fn writeFullyQualifiedDeclWithFile(mod: *Module, decl: *Decl, stream: anytype) !void { - try writeFilePath(decl.getFileScope(mod), stream); - try stream.writeAll(": "); - try decl.renderFullyQualifiedDebugName(mod, stream); +fn writeFullyQualifiedDeclWithFile(mod: *Module, decl: *Decl, writer: anytype) !void { + try writeFilePath(decl.getFileScope(mod), writer); + try writer.writeAll(": "); + try decl.renderFullyQualifiedDebugName(mod, writer); } pub fn compilerPanic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace, maybe_ret_addr: ?usize) noreturn { |
