From: Gabe Black Date: Mon, 4 Jun 2012 17:43:08 +0000 (-0700) Subject: X86: Ensure that the decoder's internal ExtMachInst is completely initialized. X-Git-Tag: stable_2012_06_28~36 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7b73c36f5d52073025223dcdaca749758d274d52;p=gem5.git X86: Ensure that the decoder's internal ExtMachInst is completely initialized. There are some bits of some fields of the ExtMachInst which are not actually used for anything but are included in the hash of an ExtMachInst for simplicity and efficiency. This change makes sure the decoder's internal working ExtMachInst is completely initialized, even these unused bits, so that there isn't any nondeterministic behavior, no valgrind messages about uninitialized variables, and no potential false misses/redundant entries in the decode cache. --- diff --git a/src/arch/x86/decoder.hh b/src/arch/x86/decoder.hh index 725d443d6..24194d839 100644 --- a/src/arch/x86/decoder.hh +++ b/src/arch/x86/decoder.hh @@ -159,6 +159,7 @@ class Decoder outOfBytes(true), instDone(false), state(ResetState) { + memset(&emi, 0, sizeof(emi)); emi.mode.mode = LongMode; emi.mode.submode = SixtyFourBitMode; m5Reg = 0;