summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2018-06-08 21:13:25 +0200
committerMark Wielaard <mark@klomp.org>2018-06-11 08:35:51 +0200
commitb78a3336d9d720515b054f250f105600ddb2bd33 (patch)
tree2fbdc6afe15afe289d1cc29ccab022e5815eb8d1
parent95e3d07a6742992cf22e239389cab12ba0d4d95d (diff)
downloadelfutils-b78a3336d9d720515b054f250f105600ddb2bd33.tar.gz
tests: Don't assert on bad DW_OP_GNU_parameter_ref target in varlocs.
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>
-rw-r--r--tests/ChangeLog5
-rw-r--r--tests/varlocs.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 3b69a87c..e5df2118 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,10 @@
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.
* show-abbrev.c (main): Check illegal dwarf_getabbrev offset call.
diff --git a/tests/varlocs.c b/tests/varlocs.c
index 99c38878..f4a711c8 100644
--- a/tests/varlocs.c
+++ b/tests/varlocs.c
@@ -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;