summaryrefslogtreecommitdiff
path: root/src/arch/x86
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86')
-rw-r--r--src/arch/x86/decoder.hh2
-rw-r--r--src/arch/x86/types.hh4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/arch/x86/decoder.hh b/src/arch/x86/decoder.hh
index 3630ea8c8..c0b30b5e8 100644
--- a/src/arch/x86/decoder.hh
+++ b/src/arch/x86/decoder.hh
@@ -239,7 +239,7 @@ class Decoder
outOfBytes(true), instDone(false),
state(ResetState)
{
- memset(&emi, 0, sizeof(emi));
+ emi.reset();
mode = LongMode;
submode = SixtyFourBitMode;
emi.mode.mode = mode;
diff --git a/src/arch/x86/types.hh b/src/arch/x86/types.hh
index 6e1b1cf2f..f2b064650 100644
--- a/src/arch/x86/types.hh
+++ b/src/arch/x86/types.hh
@@ -199,6 +199,10 @@ namespace X86ISA
//The intermediate structure used by the x86 decoder.
struct ExtMachInst
{
+ void reset() {
+ memset(static_cast<void *>(this), 0, sizeof(*this));
+ }
+
//Prefixes
LegacyPrefixVector legacy;
Rex rex;