summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2015-09-04 12:04:11 -0700
committerMark Wielaard <mjw@redhat.com>2015-09-07 23:56:33 +0200
commitb85f80ab687044ece15d51de8a5e7f63bc1d3fa9 (patch)
tree31982719267400e0d296c00e29eac7424c548cba /tests
parent4cb8f6196201a88d20f4a47fafaf0ae4e3cfa7a0 (diff)
downloadelfutils-b85f80ab687044ece15d51de8a5e7f63bc1d3fa9.tar.gz
tests: Init local variable enctype before use in print_base_type varlocs.c.
clang compiler static analysis failed. Signed-off-by: Chih-Hung Hsieh <chh@google.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog4
-rw-r--r--tests/varlocs.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 44a8f045..15c3ef9f 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,5 +1,9 @@
2015-09-04 Chih-Hung Hsieh <chh@google.com>
+ * varlocs.c (print_base_type): Initialize enctype.
+
+2015-09-04 Chih-Hung Hsieh <chh@google.com>
+
* md5-sha1-test.c (md5_expected): Removed.
(sha1_expected): Likewise.
diff --git a/tests/varlocs.c b/tests/varlocs.c
index b5733e7b..c3fba89e 100644
--- a/tests/varlocs.c
+++ b/tests/varlocs.c
@@ -82,7 +82,7 @@ print_base_type (Dwarf_Die *base)
assert (dwarf_tag (base) == DW_TAG_base_type);
Dwarf_Attribute encoding;
- Dwarf_Word enctype;
+ Dwarf_Word enctype = 0;
if (dwarf_attr (base, DW_AT_encoding, &encoding) == NULL
|| dwarf_formudata (&encoding, &enctype) != 0)
error (EXIT_FAILURE, 0, "base type without encoding");