On Fri, 2018-06-08 at 11:55 +0200, Mark Wielaard wrote: > When constructing a "fake" Dwarf_Attribute for DW_OP_GNU_const_index, > DW_OP_constx, DW_OP_GNU_addr_index or DW_OP_addrx, we would create a > fake attribute pointing to the actual data in the .debug_addr section. > > We would even do that if there was no .debug_addr section assuming > dwarf_formaddr or dwarf_formudata would generate an error. But when > there is no .debug_addr there is also no fake_addr_cu, so the > dwarf_form* functions cannot check the value is correct (and crash). > > Fix by returning an error early from dwarf_getlocation_attr indicating > bad DWARF data.
Pushed to master.