From 5d4be29ebf79b393cbba8f2e7c0a8714cc859c9c Mon Sep 17 00:00:00 2001 From: MrUser127 <189899870+MrUser127@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:01:21 +0200 Subject: [PATCH] Support call in X86InstructionSet --- Cpp2IL.Core/InstructionSets/X86InstructionSet.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Cpp2IL.Core/InstructionSets/X86InstructionSet.cs b/Cpp2IL.Core/InstructionSets/X86InstructionSet.cs index 95cf26d7..702ce9f9 100644 --- a/Cpp2IL.Core/InstructionSets/X86InstructionSet.cs +++ b/Cpp2IL.Core/InstructionSets/X86InstructionSet.cs @@ -358,7 +358,11 @@ static InstructionSetIndependentOperand ConvertVector(string reg, int imm) => var target = instruction.NearBranchTarget; - if (context.AppContext.MethodsByAddress.TryGetValue(target, out var possibleMethods)) + if (instruction.Op0Kind == OpKind.Register) + { + builder.CallRegister(instruction.IP, ConvertOperand(instruction, 0)); + } + else if (context.AppContext.MethodsByAddress.TryGetValue(target, out var possibleMethods)) { if (possibleMethods.Count == 1) {