[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
This commit is contained in:
Gliniak
2025-11-01 19:18:45 +01:00
parent 1ad35e4d61
commit f1d444dd99

View File

@@ -313,7 +313,17 @@ EMITTER_OPCODE_TABLE(OPCODE_CALL_TRUE, CALL_TRUE_I8, CALL_TRUE_I16,
struct CALL_INDIRECT
: Sequence<CALL_INDIRECT, I<OPCODE_CALL_INDIRECT, VoidOp, I64Op>> {
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();
}
};