From 1bd96304badf24d50698e04abaf8f45c31571d6d Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Thu, 28 Sep 2023 21:35:01 -0500 Subject: [PATCH] fix: off-by-one when handling TCM addresses --- src/arm.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arm.zig b/src/arm.zig index b10f20d..89ea754 100644 --- a/src/arm.zig +++ b/src/arm.zig @@ -246,7 +246,7 @@ pub fn Arm32(comptime isa: Architecture) type { if (address < 0x0000_0000 + self.itcm.virt.size) return writeInt(T, self.itcm.buf[address & self.itcm.virt.mask ..][0..@sizeOf(T)], value); - if (dtcm_base < address and address < dtcm_base + dtcm_size) + if (dtcm_base <= address and address < dtcm_base + dtcm_size) return writeInt(T, self.dtcm.buf[address & self.dtcm.virt.mask ..][0..@sizeOf(T)], value); }