From f1d444dd99eedbe6a2ae79a12a50896b46dd7074 Mon Sep 17 00:00:00 2001 From: Gliniak Date: Sat, 1 Nov 2025 19:18:45 +0100 Subject: [PATCH] [CPU/X64] Added const path for indirect call This prevents having false-positive logs about invalid handling This case should only happen on deadend paths of code like calling 0 --- src/xenia/cpu/backend/x64/x64_seq_control.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/xenia/cpu/backend/x64/x64_seq_control.cc b/src/xenia/cpu/backend/x64/x64_seq_control.cc index 5c78a52ae..5df040b4b 100644 --- a/src/xenia/cpu/backend/x64/x64_seq_control.cc +++ b/src/xenia/cpu/backend/x64/x64_seq_control.cc @@ -313,7 +313,17 @@ EMITTER_OPCODE_TABLE(OPCODE_CALL_TRUE, CALL_TRUE_I8, CALL_TRUE_I16, struct CALL_INDIRECT : Sequence> { static void Emit(X64Emitter& e, const EmitArgType& i) { - e.CallIndirect(i.instr, i.src1); + if (i.src1.is_constant) [[unlikely]] { + if (i.src1.constant() == 0) { + e.nop(); + } else { + // This isn't valid, but at least we will have log info about potential + // usecase. + e.CallIndirect(i.instr, i.src1); + } + } else { + e.CallIndirect(i.instr, i.src1); + } e.ForgetMxcsrMode(); } };