asan: ns32k: use of uninitialized value

Message ID 20200528114031.GC5475@bubble.grove.modra.org
State New
Headers show
Series
  • asan: ns32k: use of uninitialized value
Related show

Commit Message

Nick, I had this one fixed, likely before you got out of bed this
morning, but not pushed upstream.

	* ns32k-dis.c (print_insn_arg): Handle d value of 'f' for
	immediates.
	(print_insn_ns32k): Revert last change.


-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/opcodes/ns32k-dis.c b/opcodes/ns32k-dis.c
index ccad820d8f..eac461a969 100644
--- a/opcodes/ns32k-dis.c
+++ b/opcodes/ns32k-dis.c
@@ -524,9 +524,7 @@  print_insn_arg (int d,
 	  /* Immediate.  */
 	  switch (d)
 	    {
-	    case 'I':
-	    case 'Z':
-	    case 'A':
+	    default:
 	      /* I and Z are output operands and can`t be immediate
 	         A is an address and we can`t have the address of
 	         an immediate either. We don't know how much to increase
@@ -738,10 +736,7 @@  print_insn_ns32k (bfd_vma memaddr, disassemble_info *info)
   unsigned short first_word;
   int ioffset;		/* Bits into instruction.  */
   int aoffset;		/* Bits into arguments.  */
-  /* The arg_bufs array is made static in order to avoid a potential
-     use of an uninitialised value if we are asekd to disassemble a
-     corrupt instruction.  */
-  static char arg_bufs[MAX_ARGS+1][ARG_LEN];
+  char arg_bufs[MAX_ARGS+1][ARG_LEN];
   int argnum;
   int maxarg;
   struct private priv;