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");