This patch fixes an issue where the memory for the opcode structure is not zero'd before
the first exit branch. So there is one failure mode for which uninitialized memory
is returned.
This causes weird failures when the return code is not checked before inst is used.
opcodes/
* aarch64-dis.c (aarch64_opcode_decode): Moved memory clear code.
+2018-05-01 Tamar Christina <tamar.christina@arm.com>
+
+ * aarch64-dis.c (aarch64_opcode_decode): Moved memory clear code.
+
2018-04-30 Francois H. Theron <francois.theron@netronome.com>
Makefile.am: Added nfp-dis.c.
assert (opcode && inst);
+ /* Clear inst. */
+ memset (inst, '\0', sizeof (aarch64_inst));
+
/* Check the base opcode. */
if ((code & opcode->mask) != (opcode->opcode & opcode->mask))
{
goto decode_fail;
}
- /* Clear inst. */
- memset (inst, '\0', sizeof (aarch64_inst));
-
inst->opcode = opcode;
inst->value = code;