From 7e7bce4965cdd961f2dff0483841bb5be8ce18da Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 15 Sep 2018 00:28:34 +0200 Subject: [PATCH] - fixed OP_VTBL bug --- src/scripting/vm/jit.cpp | 1 - src/scripting/vm/jit_flow.cpp | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/scripting/vm/jit.cpp b/src/scripting/vm/jit.cpp index b24ac7920..032ff68d3 100644 --- a/src/scripting/vm/jit.cpp +++ b/src/scripting/vm/jit.cpp @@ -155,7 +155,6 @@ bool JitCompiler::CanJit(VMScriptFunction *sfunc) case OP_LCS_R: case OP_SS_R: case OP_IJMP: - case OP_CALL: // this one is implemented but crashes currently case OP_TAIL: case OP_TAIL_K: return false; diff --git a/src/scripting/vm/jit_flow.cpp b/src/scripting/vm/jit_flow.cpp index 708bed744..72677f846 100644 --- a/src/scripting/vm/jit_flow.cpp +++ b/src/scripting/vm/jit_flow.cpp @@ -36,15 +36,14 @@ void JitCompiler::EmitVTBL() EmitThrowException(X_READ_NIL); cc.bind(notnull); - auto result = cc.newInt32(); typedef VMFunction*(*FuncPtr)(DObject*, int); auto call = cc.call(ToMemAddress(reinterpret_cast(static_cast([](DObject *o, int c) -> VMFunction* { auto p = o->GetClass(); assert(c < (int)p->Virtuals.Size()); return p->Virtuals[c]; }))), asmjit::FuncSignature2()); - call->setRet(0, result); - call->setArg(0, regA[A]); + call->setRet(0, regA[A]); + call->setArg(0, regA[B]); call->setArg(1, asmjit::Imm(C)); }