From 1dc01923226b33affd48567e939ca4351c2b2e07 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Mon, 17 Mar 2025 15:25:49 -0700 Subject: [PATCH] fix clang warning and errors --- src/dwarf/dwarf_parse.c | 4 ++-- src/linker/hash_table.c | 11 ++++++++++- src/rdi_from_dwarf/rdi_from_dwarf_main.c | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/dwarf/dwarf_parse.c b/src/dwarf/dwarf_parse.c index e0cd5e4e..0e34a29a 100644 --- a/src/dwarf/dwarf_parse.c +++ b/src/dwarf/dwarf_parse.c @@ -1787,7 +1787,7 @@ dw_rnglist_from_attrib_ptr(Arena *arena, DW_Input *input, DW_CompUnit *cu, DW_At { Rng1U64List rnglist = {0}; DW_AttribClass value_class = dw_value_class_from_attrib(cu, attrib); - if (value_class == DW_AttribClass_RngListPtr || DW_AttribClass_RngList) { + if (value_class == DW_AttribClass_RngListPtr || value_class == DW_AttribClass_RngList) { rnglist = dw_interp_rnglist(arena, input, cu, attrib->form_kind, attrib->form); } else if (value_class != DW_AttribClass_Null) { Assert(!"unexpected value class"); @@ -1947,7 +1947,7 @@ dw_byte_size_from_tag(DW_Input *input, DW_CompUnit *cu, DW_Tag tag) internal U32 dw_byte_size_32_from_tag(DW_Input *input, DW_CompUnit *cu, DW_Tag tag) { - U32 byte_size32; + U32 byte_size32 = 0; U64 byte_size64; if (dw_try_byte_size_from_tag(input, cu, tag, &byte_size64)) { byte_size32 = safe_cast_u32(byte_size64); diff --git a/src/linker/hash_table.c b/src/linker/hash_table.c index ae70ab2a..cbb478ad 100644 --- a/src/linker/hash_table.c +++ b/src/linker/hash_table.c @@ -4,7 +4,16 @@ internal void bucket_list_concat_in_place(BucketList *list, BucketList *to_concat) { - SLLConcatInPlaceNoCount(list, to_concat); + if (to_concat->first) { + if (list->first) { + list->last->next = to_concat->first; + list->last = to_concat->last; + } else { + list->first = to_concat->first; + list->last = to_concat->last; + } + MemoryZeroStruct(to_concat); + } } internal BucketNode * diff --git a/src/rdi_from_dwarf/rdi_from_dwarf_main.c b/src/rdi_from_dwarf/rdi_from_dwarf_main.c index 32ea0331..07c2410f 100644 --- a/src/rdi_from_dwarf/rdi_from_dwarf_main.c +++ b/src/rdi_from_dwarf/rdi_from_dwarf_main.c @@ -10,6 +10,7 @@ #include "third_party/rad_lzb_simple/rad_lzb_simple.c" #include "third_party/xxHash/xxhash.c" #include "third_party/xxHash/xxhash.h" +#include "third_party/radsort/radsort.h" ////////////////////////////////