From c164b3c3b0d82025b93f239f2297b71fe1d568a2 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sun, 25 Nov 2018 22:26:38 +0100 Subject: [PATCH] - fix: float constants got their move instructions inserted after the call instruction --- src/scripting/vm/jit_call.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/scripting/vm/jit_call.cpp b/src/scripting/vm/jit_call.cpp index e35ad697d..c86176c34 100644 --- a/src/scripting/vm/jit_call.cpp +++ b/src/scripting/vm/jit_call.cpp @@ -317,13 +317,16 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target) { using namespace asmjit; - auto call = cc.call(imm_ptr(target->DirectNativeCall), CreateFuncSignature(target)); - if ((pc - 1)->op == OP_VTBL) { I_FatalError("Native direct member function calls not implemented\n"); } + asmjit::CBNode *cursorBefore = cc.getCursor(); + auto call = cc.call(imm_ptr(target->DirectNativeCall), CreateFuncSignature(target)); + asmjit::CBNode *cursorAfter = cc.getCursor(); + cc.setCursor(cursorBefore); + X86Gp tmp; X86Xmm tmp2; @@ -398,6 +401,8 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target) } } + cc.setCursor(cursorAfter); + if (numparams != B) I_FatalError("OP_CALL parameter count does not match the number of preceding OP_PARAM instructions\n");