From b12e1a1b6e2c983f522ef1369a6bfb8167b1bf4c Mon Sep 17 00:00:00 2001 From: RSDuck Date: Tue, 25 Aug 2020 18:13:17 +0200 Subject: JIT fastmem: fix out of bounds read seems to fix #727 --- src/ARMJIT_Memory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/ARMJIT_Memory.cpp') diff --git a/src/ARMJIT_Memory.cpp b/src/ARMJIT_Memory.cpp index 7885fb7..c5c8f04 100644 --- a/src/ARMJIT_Memory.cpp +++ b/src/ARMJIT_Memory.cpp @@ -524,8 +524,8 @@ bool MapAtAddress(u32 addr) { u32 sectionOffset = offset; bool hasCode = isExecutable && ARMJIT::PageContainsCode(&range[offset / 512]); - while ((!isExecutable || ARMJIT::PageContainsCode(&range[offset / 512]) == hasCode) - && offset < mirrorSize + while (offset < mirrorSize + && (!isExecutable || ARMJIT::PageContainsCode(&range[offset / 512]) == hasCode) && (!skipDTCM || mirrorStart + offset != NDS::ARM9->DTCMBase)) { assert(states[(mirrorStart + offset) >> 12] == memstate_Unmapped); -- cgit v1.2.3