File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -478,9 +478,15 @@ const LineNumberProgram = struct {
478
478
if (file_entry .dir_index >= self .include_dirs .len ) return badDwarf ();
479
479
const dir_name = self .include_dirs [file_entry .dir_index ].path ;
480
480
481
- const file_name = try fs .path .join (allocator , &[_ ][]const u8 {
482
- dir_name , file_entry .path ,
483
- });
481
+ // This will break when the system running this code has different
482
+ // path separators than what generated the debug info. This was deemed
483
+ // acceptable as this code is really only designed to be used in
484
+ // combination with std.debug
485
+ const parts = if (file_entry .dir_index > 0 and ! fs .path .isAbsolute (dir_name ))
486
+ &[_ ][]const u8 { self .include_dirs [0 ].path , dir_name , file_entry .path }
487
+ else
488
+ &[_ ][]const u8 { dir_name , file_entry .path };
489
+ const file_name = try fs .path .join (allocator , parts );
484
490
485
491
return debug.LineInfo {
486
492
.line = if (self .prev_line >= 0 ) @intCast (u64 , self .prev_line ) else 0 ,
You can’t perform that action at this time.
0 commit comments