Ignore dwarf struct types with DW_AT_declaration

Fixes #23557

Signed-off-by: wagner riffel <w@104d.net>
This commit is contained in:
wagner riffel 2024-10-29 12:48:55 -03:00 committed by pancake
parent e8de77f5cc
commit ed8ce7c0b2
2 changed files with 15 additions and 0 deletions

View File

@ -516,6 +516,10 @@ cleanup:
static void parse_structure_type(Context *ctx, ut64 idx) {
const RBinDwarfDie *die = &ctx->all_dies[idx];
if (find_attr_idx (die, DW_AT_declaration) != -1) {
return;
}
RAnalBaseTypeKind kind;
if (die->tag == DW_TAG_union_type) {
kind = R_ANAL_BASE_TYPE_KIND_UNION;

View File

@ -824,3 +824,14 @@ EXPECT=<<EOF
typedef char * string;
EOF
RUN
NAME=dwarf declaration dont overwrite type
FILE=bins/elf/dwarf_typedecl
CMDS=tsc
EXPECT=<<EOF
struct Foo {
int bar;
int baz;
};
EOF
RUN