Re: ARC: Use of uninitialised value
authorAlan Modra <amodra@gmail.com>
Thu, 26 Mar 2020 05:50:47 +0000 (16:20 +1030)
committerAlan Modra <amodra@gmail.com>
Thu, 26 Mar 2020 09:32:42 +0000 (20:02 +1030)
git commit beea5cc1bc fixed one use of an uninitialised value but
ignored another one a few lines later.

* arc-dis.c (find_format): Init needs_limm.  Simplify use of limm.

opcodes/ChangeLog
opcodes/arc-dis.c

index bdfccbac78c8d8c3539e4a60ca36ef5b87b179b7..a88a762c3a4d61964310753b712f7665f82b322c 100644 (file)
@@ -1,3 +1,7 @@
+2020-03-26  Alan Modra  <amodra@gmail.com>
+
+       * arc-dis.c (find_format): Init needs_limm.  Simplify use of limm.
+
 2020-03-25  Alan Modra  <amodra@gmail.com>
 
        * z80-dis.c (suffix): Init mybuf.
index 131aee6b34e546f69fe8b93f4d96d0884c7db21b..dc9e490ce8aed8fcafdd1b0f76182b1667c92a27 100644 (file)
@@ -420,7 +420,7 @@ find_format (bfd_vma                       memaddr,
              struct arc_operand_iterator * iter)
 {
   const struct arc_opcode *opcode = NULL;
-  bfd_boolean needs_limm;
+  bfd_boolean needs_limm = FALSE;
   const extInstruction_t *einsn, *i;
   unsigned limm = 0;
   struct arc_disassemble_info *arc_infop = info->private_data;
@@ -483,7 +483,7 @@ find_format (bfd_vma                       memaddr,
 
   /* Update private data.  */
   arc_infop->opcode = opcode;
-  arc_infop->limm = (needs_limm) ? limm : 0;
+  arc_infop->limm = limm;
   arc_infop->limm_p = needs_limm;
 
   return TRUE;
This page took 0.025986 seconds and 4 git commands to generate.