When using the varlocs test with a fuzzer using assert for internal
sanity checks is great to find issues. But when encountering bad data
using an assert is wrong. Just use error to show we handle the data
correctly (by reporting it is bad, instead of crashing).
Signed-off-by: Mark Wielaard <mark@klomp.org>
+2018-06-06 Mark Wielaard <mark@klomp.org>
+
+ * varlocs.c (print_base_type): Use error, not assert when the DIE
+ isn't a base type.
+
2018-06-02 Mark Wielaard <mark@klomp.org>
* test-subr.sh (self_test_files_exe): Drop shared libraries.
static void
print_base_type (Dwarf_Die *base)
{
- assert (dwarf_tag (base) == DW_TAG_base_type);
+ if (dwarf_tag (base) != DW_TAG_base_type)
+ error (EXIT_FAILURE, 0, "not a base type");
Dwarf_Attribute encoding;
Dwarf_Word enctype = 0;