]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Don't assert on bad DW_OP_GNU_parameter_ref target in varlocs.
authorMark Wielaard <mark@klomp.org>
Fri, 8 Jun 2018 19:13:25 +0000 (21:13 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 11 Jun 2018 06:35:51 +0000 (08:35 +0200)
If the target of a DW_OP_GNU_parameter_ref isn't a DW_TAG_formal_parameter
that is bad data (which varlocs should error on). But it isn't an internal
consistency check (for which varlocs should assert).

Signed-off-by: Mark Wielaard <mark@klomp.org>
tests/ChangeLog
tests/varlocs.c

index 3b69a87c274239db2c88a3620c54a8cab8bc9f65..e5df2118c858e82e692301f076ac41818caf5fa9 100644 (file)
@@ -1,3 +1,8 @@
+2018-06-08  Mark Wielaard  <mark@klomp.org>
+
+       * varlocs.c (print_expr): Error on bad DW_OP_GNU_parameter_ref
+       target, do not assert.
+
 2018-06-08  Mark Wielaard  <mark@klomp.org>
 
        * get-units-invalid.c (main): Check invalid dwarf_getabbrev call.
index 99c38878f6d8ef85890eb6d30377995e2dedf074..f4a711c83052323bf78ca4b0fb142440730d0eec 100644 (file)
@@ -546,7 +546,8 @@ print_expr (Dwarf_Attribute *attr, Dwarf_Op *expr, Dwarf_Addr addr)
        // XXX actually lookup DW_TAG_GNU_call_site_parameter
        printf ("%s[%" PRIx64 "]", opname, dwarf_dieoffset (&param));
        assert (expr->number == dwarf_cuoffset (&param));
-       assert (dwarf_tag (&param) == DW_TAG_formal_parameter);
+       if (dwarf_tag (&param) != DW_TAG_formal_parameter)
+         error (EXIT_FAILURE, 0, "Not a formal parameter");
       }
       break;