summaryrefslogtreecommitdiff
path: root/src/arch/arm/decoder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm/decoder.cc')
-rw-r--r--src/arch/arm/decoder.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/arch/arm/decoder.cc b/src/arch/arm/decoder.cc
index f57e340de..23fa89a3f 100644
--- a/src/arch/arm/decoder.cc
+++ b/src/arch/arm/decoder.cc
@@ -139,7 +139,7 @@ void
Decoder::consumeBytes(int numBytes)
{
offset += numBytes;
- assert(offset <= sizeof(MachInst));
+ assert(offset <= sizeof(MachInst) || emi.decoderFault);
if (offset == sizeof(MachInst))
outOfBytes = true;
}
@@ -154,6 +154,10 @@ Decoder::moreBytes(const PCState &pc, Addr fetchPC, MachInst inst)
emi.fpscrLen = fpscrLen;
emi.fpscrStride = fpscrStride;
+ const Addr alignment(pc.thumb() ? 0x1 : 0x3);
+ emi.decoderFault = static_cast<uint8_t>(
+ pc.instAddr() & alignment ? DecoderFault::UNALIGNED : DecoderFault::OK);
+
outOfBytes = false;
process();
}