Add a check for dwarf_get_version_of_die's return code

This commit is contained in:
Jeremy Rifkin 2025-02-17 23:00:12 -06:00
parent 6d41ea0135
commit 34be9f2f19
No known key found for this signature in database
GPG Key ID: 19AA8270105E8EB4

View File

@ -376,7 +376,7 @@ namespace libdwarf {
walk_compilation_units([this] (const die_object& cu_die) {
Dwarf_Half offset_size = 0;
Dwarf_Half dwversion = 0;
dwarf_get_version_of_die(cu_die.get(), &dwversion, &offset_size);
VERIFY(dwarf_get_version_of_die(cu_die.get(), &dwversion, &offset_size) == DW_DLV_OK);
if(skeleton) {
// NOTE: If we have a corresponding skeleton, we assume we have one CU matching the skeleton CU
// Precedence for this assumption is https://dwarfstd.org/doc/DWARF5.pdf#subsection.3.1.3