aarch64-uninit-mem
authorMatthias Klose <doko@debian.org>
Tue, 29 May 2018 13:46:35 +0000 (14:46 +0100)
committerMatthias Klose <doko@debian.org>
Tue, 29 May 2018 13:46:35 +0000 (14:46 +0100)
opcodes/

2018-05-01  Tamar Christina  <tamar.christina@arm.com>

* aarch64-dis.c (aarch64_opcode_decode): Moved memory clear code.

Gbp-Pq: Name aarch64-uninit-mem.diff

opcodes/aarch64-dis.c

index a7f5cfc83a2801853078219e0904cab052ca44f8..ad515f233feb98d34ab089d6e2323dda40969c99 100644 (file)
@@ -2733,6 +2733,9 @@ aarch64_opcode_decode (const aarch64_opcode *opcode, const aarch64_insn code,
 
   assert (opcode && inst);
 
+  /* Clear inst.  */
+  memset (inst, '\0', sizeof (aarch64_inst));
+
   /* Check the base opcode.  */
   if ((code & opcode->mask) != (opcode->opcode & opcode->mask))
     {
@@ -2740,9 +2743,6 @@ aarch64_opcode_decode (const aarch64_opcode *opcode, const aarch64_insn code,
       goto decode_fail;
     }
 
-  /* Clear inst.  */
-  memset (inst, '\0', sizeof (aarch64_inst));
-
   inst->opcode = opcode;
   inst->value = code;