From 9a1efacefecb7a6c050d7fbc417b37eb3c2b410c Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Mon, 21 Jul 2025 18:03:54 +0100 Subject: [PATCH] OpcodeDispatcher: Allow for direct linking of non-multiblock direct jumps Using an add here prevents ExitFunction from taking the direct path. Reported by chengmingtang on Discord. --- FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp index c1e95e5ad..54bf8a0d3 100644 --- a/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp +++ b/FEXCore/Source/Interface/Core/OpcodeDispatcher.cpp @@ -939,16 +939,8 @@ void OpDispatchBuilder::JUMPOp(OpcodeArgs) { StartNewBlock(); ExitFunction(GetRelocatedPC(Op, TargetOffset)); } - return; - } - - // Fallback - { - auto RIPTargetConst = GetRelocatedPC(Op); - auto NewRIP = _Add(OpSize::i64Bit, _Constant(TargetOffset), RIPTargetConst); - - // Store the new RIP - ExitFunction(NewRIP); + } else { + ExitFunction(GetRelocatedPC(Op, TargetOffset)); } }