From 9742eb07ba74b24952253384581a056860f32826 Mon Sep 17 00:00:00 2001 From: Dodji Seketeli Date: Sat, 26 Jul 2014 10:07:36 +0200 Subject: [PATCH] Better handle corner cases of void* DWARF parsing * src/abg-dwarf-reader.cc (build_pointer_type_def): Better support cases where the underlying type of the pointer is not know. In that case, the pointer should not be created. Signed-off-by: Dodji Seketeli --- src/abg-dwarf-reader.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/abg-dwarf-reader.cc b/src/abg-dwarf-reader.cc index 13e92eef..fb70f8a1 100644 --- a/src/abg-dwarf-reader.cc +++ b/src/abg-dwarf-reader.cc @@ -4703,12 +4703,15 @@ build_pointer_type_def(read_context& ctxt, decl_base_sptr utype_decl; Dwarf_Die underlying_type_die; + bool has_underlying_type_die = false; if (!die_die_attribute(die, DW_AT_type, underlying_type_die)) // If the DW_AT_type attribute is missing, that means we are // looking at a pointer to "void". utype_decl = build_ir_node_for_void_type(ctxt); + else + has_underlying_type_die = true; - if (!utype_decl) + if (!utype_decl && has_underlying_type_die) utype_decl = build_ir_node_from_die(ctxt, &underlying_type_die, called_from_public_decl, where_offset);