From ab617c3a9128602cc9b26eacf7a7ef3532453750 Mon Sep 17 00:00:00 2001 From: Chronos Ouroboros Date: Wed, 4 Dec 2019 17:37:20 -0300 Subject: [PATCH] Fixed the JIT's OP_VTBL check not checking if it's already at the start of the code. --- src/scripting/vm/jit_call.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scripting/vm/jit_call.cpp b/src/scripting/vm/jit_call.cpp index 14b3d5787..ee35fc139 100644 --- a/src/scripting/vm/jit_call.cpp +++ b/src/scripting/vm/jit_call.cpp @@ -78,7 +78,7 @@ void JitCompiler::EmitVMCall(asmjit::X86Gp vmfunc, VMFunction *target) if (numparams != B) I_Error("OP_CALL parameter count does not match the number of preceding OP_PARAM instructions"); - if ((pc - 1)->op == OP_VTBL) + if (pc > sfunc->Code && (pc - 1)->op == OP_VTBL) EmitVtbl(pc - 1); FillReturns(pc + 1, C); @@ -318,7 +318,7 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target) { using namespace asmjit; - if ((pc - 1)->op == OP_VTBL) + if (pc > sfunc->Code && (pc - 1)->op == OP_VTBL) { I_Error("Native direct member function calls not implemented\n"); }