]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests: Init local variable enctype before use in print_base_type varlocs.c.
authorChih-Hung Hsieh <chh@google.com>
Fri, 4 Sep 2015 19:04:11 +0000 (12:04 -0700)
committerMark Wielaard <mjw@redhat.com>
Mon, 7 Sep 2015 21:56:33 +0000 (23:56 +0200)
clang compiler static analysis failed.

Signed-off-by: Chih-Hung Hsieh <chh@google.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
tests/ChangeLog
tests/varlocs.c

index 44a8f0454d4339fab872d26883294478a3e962e1..15c3ef9f9e182796527e8cb2bd662ed29f483678 100644 (file)
@@ -1,3 +1,7 @@
+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.
index b5733e7bfed2701e41974b904880ee6430517731..c3fba89ec5621718a494d1d8bdc717d3ed114de6 100644 (file)
@@ -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");