aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--machine/misaligned_ldst.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/machine/misaligned_ldst.c b/machine/misaligned_ldst.c
index 2225ea1..dd56f7f 100644
--- a/machine/misaligned_ldst.c
+++ b/machine/misaligned_ldst.c
@@ -39,7 +39,7 @@ void misaligned_load_trap(uintptr_t* regs, uintptr_t mcause, uintptr_t mepc)
return truly_illegal_insn(regs, mcause, mepc, mstatus, insn);
val.int64 = 0;
- for (intptr_t i = len-1; i >= 0; i--)
+ for (intptr_t i = 0; i < len; i++)
val.bytes[i] = load_uint8_t((void *)(addr + i), mepc);
if (!fp)