]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Initialize variable before use.
authorChih-Hung Hsieh <chh@google.com>
Wed, 9 Sep 2015 20:59:19 +0000 (13:59 -0700)
committerMark Wielaard <mjw@redhat.com>
Thu, 10 Sep 2015 12:02:24 +0000 (14:02 +0200)
Some compiler does not know that error function never returns.

Signed-off-by: Chih-Hung Hsieh <chh@google.com>
src/ChangeLog
src/readelf.c

index fb928075ffed20510cb241f21e02c1c6651b1ab5..238c4160f7474c10d97b0847ab3148c47cc35d87 100644 (file)
@@ -1,3 +1,9 @@
+2015-09-09  Chih-Hung Hsieh  <chh@google.com>
+
+       * readelf.c (print_debug_exception_table): Initialize variable before
+       it is used, because compiler does not know that error never returns.
+       (dump_arhive_index): Likewise.
+
 2015-09-04  Chih-Hung Hsieh  <chh@google.com>
 
        * elflint.c (check_group): Replace %Z length modifier with %z.
index 8e644003f799396b52ff2f016563f97e76a74035..33274f358f641112c2a556a0588fe471ae204e60 100644 (file)
@@ -7910,6 +7910,7 @@ print_debug_exception_table (Dwfl_Module *dwflmod __attribute__ ((unused)),
          dsize = 8;
          break;
        default:
+         dsize = 0;
          error (1, 0, gettext ("invalid TType encoding"));
        }
 
@@ -9567,7 +9568,7 @@ dump_archive_index (Elf *elf, const char *fname)
        {
          as_off = s->as_off;
 
-         Elf *subelf;
+         Elf *subelf = NULL;
          if (unlikely (elf_rand (elf, as_off) == 0)
              || unlikely ((subelf = elf_begin (-1, ELF_C_READ_MMAP, elf))
                           == NULL))