From d84b386f6034278c8a9e8c3d2b0975ac541584aa Mon Sep 17 00:00:00 2001 From: "J.C. Moyer" Date: Mon, 28 Jun 2021 17:31:47 -0400 Subject: stage2: print valid filename in error messages --- src/Compilation.zig | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Compilation.zig') diff --git a/src/Compilation.zig b/src/Compilation.zig index 4e6bede26b..065890d9fe 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -402,10 +402,10 @@ pub const AllErrors = struct { const source = try module_note.src_loc.file_scope.getSource(module.gpa); const byte_offset = try module_note.src_loc.byteOffset(module.gpa); const loc = std.zig.findLineColumn(source, byte_offset); - const sub_file_path = module_note.src_loc.file_scope.sub_file_path; + const file_path = try module_note.src_loc.file_scope.fullPath(&arena.allocator); note.* = .{ .src = .{ - .src_path = try arena.allocator.dupe(u8, sub_file_path), + .src_path = file_path, .msg = try arena.allocator.dupe(u8, module_note.msg), .byte_offset = byte_offset, .line = @intCast(u32, loc.line), @@ -425,10 +425,10 @@ pub const AllErrors = struct { const source = try module_err_msg.src_loc.file_scope.getSource(module.gpa); const byte_offset = try module_err_msg.src_loc.byteOffset(module.gpa); const loc = std.zig.findLineColumn(source, byte_offset); - const sub_file_path = module_err_msg.src_loc.file_scope.sub_file_path; + const file_path = try module_err_msg.src_loc.file_scope.fullPath(&arena.allocator); try errors.append(.{ .src = .{ - .src_path = try arena.allocator.dupe(u8, sub_file_path), + .src_path = file_path, .msg = try arena.allocator.dupe(u8, module_err_msg.msg), .byte_offset = byte_offset, .line = @intCast(u32, loc.line), @@ -479,7 +479,7 @@ pub const AllErrors = struct { note.* = .{ .src = .{ - .src_path = try arena.dupe(u8, file.sub_file_path), + .src_path = try file.fullPath(arena), .msg = try arena.dupe(u8, msg), .byte_offset = byte_offset, .line = @intCast(u32, loc.line), @@ -505,7 +505,7 @@ pub const AllErrors = struct { try errors.append(.{ .src = .{ - .src_path = try arena.dupe(u8, file.sub_file_path), + .src_path = try file.fullPath(arena), .msg = try arena.dupe(u8, msg), .byte_offset = byte_offset, .line = @intCast(u32, loc.line), -- cgit v1.2.3