From 0fc337cdc137ff0938aea299d946fd13db601e5a Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 5 Sep 2023 23:50:36 -0700 Subject: [PATCH] x86jit: Correct jitbase range comparison. --- Core/MIPS/x86/X64IRAsm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/MIPS/x86/X64IRAsm.cpp b/Core/MIPS/x86/X64IRAsm.cpp index 2a5fb91152..8e24b0ff96 100644 --- a/Core/MIPS/x86/X64IRAsm.cpp +++ b/Core/MIPS/x86/X64IRAsm.cpp @@ -58,13 +58,13 @@ void X64JitBackend::GenerateFixedCode(MIPSState *mipsState) { int jitbaseCtxDisp = 0; // We pre-bake the MIPS_EMUHACK_OPCODE subtraction into our jitbase value. intptr_t jitbase = (intptr_t)GetBasePtr() - MIPS_EMUHACK_OPCODE; - if ((jitbase < -0x80000000ULL || jitbase > 0x7FFFFFFFULL) && !Accessible((const u8 *)&mipsState->f[0], GetBasePtr())) { + if ((jitbase < -0x80000000LL || jitbase > 0x7FFFFFFFLL) && !Accessible((const u8 *)&mipsState->f[0], GetBasePtr())) { jo.reserveR15ForAsm = true; jitbaseInR15 = true; } else { jo.downcountInRegister = true; jo.reserveR15ForAsm = true; - if (jitbase < -0x80000000ULL || jitbase > 0x7FFFFFFFULL) { + if (jitbase < -0x8000000ULL || jitbase > 0x7FFFFFFFLL) { jitbaseCtxDisp = (int)(jitbase - (intptr_t)&mipsState->f[0]); } }