From ca4e0495c03b72cb2e2cf47f093db54409cb3937 Mon Sep 17 00:00:00 2001 From: magumagu Date: Tue, 25 Mar 2014 20:50:14 -0700 Subject: [PATCH] Save registers before calls in x86-32 JIT. I have no idea what the person who added RegistersInUse() was thinking, but not correctly saving registers is an easy way to end up with crashes. --- Source/Core/Core/PowerPC/Jit64/Jit.cpp | 5 ----- Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp | 5 ----- 2 files changed, 10 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit.cpp b/Source/Core/Core/PowerPC/Jit64/Jit.cpp index 686805bce2..9e1eeec222 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit.cpp @@ -726,7 +726,6 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer *code_buf, JitBloc u32 Jit64::RegistersInUse() { -#if _M_X86_64 u32 result = 0; for (int i = 0; i < NUMXREGS; i++) { @@ -736,8 +735,4 @@ u32 Jit64::RegistersInUse() result |= (1 << (16 + i)); } return result; -#else - // not needed - return 0; -#endif } diff --git a/Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp index 689b4c48bd..53d0323c71 100644 --- a/Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/PowerPC/Jit64IL/IR_X86.cpp @@ -61,7 +61,6 @@ struct RegInfo { }; static u32 regsInUse(RegInfo& R) { -#if _M_X86_64 u32 result = 0; for (unsigned i = 0; i < MAX_NUMBER_OF_REGS; i++) { @@ -71,10 +70,6 @@ static u32 regsInUse(RegInfo& R) { result |= (1 << (16 + i)); } return result; -#else - // not needed - return 0; -#endif } static void regMarkUse(RegInfo& R, InstLoc I, InstLoc Op, unsigned OpNum) {