summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorhrydgard <hrydgard@gmail.com>2008-08-14 22:01:07 +0000
committerhrydgard <hrydgard@gmail.com>2008-08-14 22:01:07 +0000
commit9e15c51f9eff8fc2ca7a29530dc831639577bace (patch)
tree5fc06b28370c8c99af0250014a29688cf77595b2 /Source/Core
parentaae50ada0e4d384fd0c78f0334c8d9c07734191e (diff)
Silly build fix, a slightly improved error message.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@212 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp b/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp
index 2a22a4f29e..8b99da3fa2 100644
--- a/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp
+++ b/Source/Core/Core/Src/PowerPC/Jit64/JitBackpatch.cpp
@@ -70,7 +70,12 @@ void BackPatch(u8 *codePtr, int accessType, u32 emAddress)
if (!DisassembleMov(codePtr, info, accessType)) {
BackPatchError("BackPatch - failed to disassemble MOV instruction", codePtr, emAddress);
}
+
if (info.isMemoryWrite) {
+ if (!Memory::IsRAMAddress(emAddress, true)) {
+ PanicAlert("Write to invalid address %08x", emAddress);
+ return;
+ }
BackPatchError("BackPatch - determined that MOV is write, not yet supported and should have been caught before",
codePtr, emAddress);
}
@@ -86,8 +91,7 @@ void BackPatch(u8 *codePtr, int accessType, u32 emAddress)
if (accessType == OP_ACCESS_WRITE)
PanicAlert("BackPatch : Currently only supporting reads."
"\n\nAttempted to write to %08x.", emAddress);
- //if (info.instructionSize < 5)
- // PanicAlert("Instruction at %08x Too Small : %i", (u32)codePtr, info.instructionSize);
+
// OK, let's write a trampoline, and a jump to it.
// Later, let's share trampolines.
@@ -109,7 +113,6 @@ void BackPatch(u8 *codePtr, int accessType, u32 emAddress)
// CALL((void *)&Memory::Read_U8);
// break;
case 4:
- // THIS FUNCTION CANNOT TOUCH FLOATING POINT REGISTERS.
CALL(ProtectFunction((void *)&Memory::Read_U32, 1));
break;
default: