Jit64: Fix crash at startup

This was a regression introduced by 4d8d045. stored_stack_pointer within
PPCSTATE was being accessed before the PPCSTATE (RBP) register was
initialized.
This commit is contained in:
Stenzek 2017-03-26 11:37:55 +10:00
parent 86e6b44271
commit 724a8437eb
1 changed files with 5 additions and 4 deletions

View File

@ -36,6 +36,11 @@ void Jit64AsmRoutineManager::Generate()
// for the shadow region before calls in this function. This call will
// waste a bit of space for a second shadow, but whatever.
ABI_PushRegistersAndAdjustStack(ABI_ALL_CALLEE_SAVED, 8, /*frame*/ 16);
// Two statically allocated registers.
// MOV(64, R(RMEM), Imm64((u64)Memory::physical_base));
MOV(64, R(RPPCSTATE), Imm64((u64)&PowerPC::ppcState + 0x80));
if (m_stack_top)
{
// Pivot the stack to our custom one.
@ -50,10 +55,6 @@ void Jit64AsmRoutineManager::Generate()
// something that can't pass the BLR test
MOV(64, MDisp(RSP, 8), Imm32((u32)-1));
// Two statically allocated registers.
// MOV(64, R(RMEM), Imm64((u64)Memory::physical_base));
MOV(64, R(RPPCSTATE), Imm64((u64)&PowerPC::ppcState + 0x80));
const u8* outerLoop = GetCodePtr();
ABI_PushRegistersAndAdjustStack({}, 0);
ABI_CallFunction(CoreTiming::Advance);