fix incorrect dwarf file deduplication

This commit is contained in:
Ryan Fleury committed 2026-08-27 20:00:01 -06:00
1 parent c97907a7b9
commit 7a5a649b89
1 file changed
+4
+4
View File
@@ -436,6 +436,8 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params)
for EachIndex(file_idx, hdr->files.count) for EachIndex(file_idx, hdr->files.count)
{ {
DW2_LineTableFile *f = &hdr->files.v[file_idx]; DW2_LineTableFile *f = &hdr->files.v[file_idx];
if(f->file_name.size != 0)
{
DW2_LineTableFile *dir = &hdr->dirs.v[f->dir_idx]; DW2_LineTableFile *dir = &hdr->dirs.v[f->dir_idx];
String8 full_file_path = str8f(scratch2.arena, "%S%s%S", dir->file_name, dir->file_name.size != 0 ? "/" : "", f->file_name); String8 full_file_path = str8f(scratch2.arena, "%S%s%S", dir->file_name, dir->file_name.size != 0 ? "/" : "", f->file_name);
U64 hash = u64_hash_from_str8(full_file_path); U64 hash = u64_hash_from_str8(full_file_path);
@@ -452,6 +454,7 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params)
if(!node) if(!node)
{ {
node = push_array(scratch2.arena, SrcFileNode, 1); node = push_array(scratch2.arena, SrcFileNode, 1);
SLLStackPush(slots[slot_idx], node);
node->full_path = full_file_path; node->full_path = full_file_path;
node->src_file = rdim_src_file_chunk_list_push(arena, all_src_files, slots_count); node->src_file = rdim_src_file_chunk_list_push(arena, all_src_files, slots_count);
node->src_file->path = str8_copy(arena, full_file_path); node->src_file->path = str8_copy(arena, full_file_path);
@@ -469,6 +472,7 @@ d2r_convert(Arena *arena, D2R_ConvertParams *params)
unit_src_file_maps[unit_idx].v[file_idx] = node->src_file; unit_src_file_maps[unit_idx].v[file_idx] = node->src_file;
} }
} }
}
scratch_end(scratch2); scratch_end(scratch2);
} }
lane_sync_u64(&all_src_files, 0); lane_sync_u64(&all_src_files, 0);