From 6fa71607e236aaa7a8cd31f7da791c4a8b563400 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Fri, 21 Nov 2025 16:10:28 -0800 Subject: [PATCH] do not emit global vars for decls --- src/rdi_from_dwarf/rdi_from_dwarf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rdi_from_dwarf/rdi_from_dwarf.c b/src/rdi_from_dwarf/rdi_from_dwarf.c index 45f13d62..570d01ca 100644 --- a/src/rdi_from_dwarf/rdi_from_dwarf.c +++ b/src/rdi_from_dwarf/rdi_from_dwarf.c @@ -2479,6 +2479,10 @@ d2r_convert_symbols(Arena *arena, // NOTE: due to a bug in clang in stb_sprint.h local variables // are declared in global scope without a name if (name.size == 0) { break; } + + // decls do not have location info + B32 is_decl = dw_flag_from_tag_attrib_kind(input, cu, tag, DW_AttribKind_Declaration); + if (is_decl) { break; } U64 voff = max_U64; B32 is_thread_var = 0;