From 286c153c6a850d6d48a8b2a30c578f4646d4ed59 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 6 Jul 2013 13:15:48 -0700 Subject: [PATCH] Fix memchecks for halfwords and bytes. Before it was doing the range on a 4 byte read, which would trip a memcheck that wasn't actually being hit if the byte of halfword was unaligned. --- Core/MIPS/x86/CompLoadStore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/MIPS/x86/CompLoadStore.cpp b/Core/MIPS/x86/CompLoadStore.cpp index 2ff24b8279..6469aebea4 100644 --- a/Core/MIPS/x86/CompLoadStore.cpp +++ b/Core/MIPS/x86/CompLoadStore.cpp @@ -53,7 +53,7 @@ namespace MIPSComp JitSafeMem safe(this, rs, offset); OpArg src; - if (safe.PrepareRead(src, 4)) + if (safe.PrepareRead(src, bits / 8)) (this->*mov)(32, bits, gpr.RX(rt), src); if (safe.PrepareSlowRead(safeFunc)) (this->*mov)(32, bits, gpr.RX(rt), R(EAX)); @@ -83,7 +83,7 @@ namespace MIPSComp JitSafeMem safe(this, rs, offset); OpArg dest; - if (safe.PrepareWrite(dest, 4)) + if (safe.PrepareWrite(dest, bits / 8)) { if (needSwap) {