mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-29 07:22:05 +00:00
- fixed OP_VTBL bug
This commit is contained in:
parent
266f838de7
commit
7e7bce4965
2 changed files with 2 additions and 4 deletions
|
@ -155,7 +155,6 @@ bool JitCompiler::CanJit(VMScriptFunction *sfunc)
|
||||||
case OP_LCS_R:
|
case OP_LCS_R:
|
||||||
case OP_SS_R:
|
case OP_SS_R:
|
||||||
case OP_IJMP:
|
case OP_IJMP:
|
||||||
case OP_CALL: // this one is implemented but crashes currently
|
|
||||||
case OP_TAIL:
|
case OP_TAIL:
|
||||||
case OP_TAIL_K:
|
case OP_TAIL_K:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -36,15 +36,14 @@ void JitCompiler::EmitVTBL()
|
||||||
EmitThrowException(X_READ_NIL);
|
EmitThrowException(X_READ_NIL);
|
||||||
cc.bind(notnull);
|
cc.bind(notnull);
|
||||||
|
|
||||||
auto result = cc.newInt32();
|
|
||||||
typedef VMFunction*(*FuncPtr)(DObject*, int);
|
typedef VMFunction*(*FuncPtr)(DObject*, int);
|
||||||
auto call = cc.call(ToMemAddress(reinterpret_cast<const void*>(static_cast<FuncPtr>([](DObject *o, int c) -> VMFunction* {
|
auto call = cc.call(ToMemAddress(reinterpret_cast<const void*>(static_cast<FuncPtr>([](DObject *o, int c) -> VMFunction* {
|
||||||
auto p = o->GetClass();
|
auto p = o->GetClass();
|
||||||
assert(c < (int)p->Virtuals.Size());
|
assert(c < (int)p->Virtuals.Size());
|
||||||
return p->Virtuals[c];
|
return p->Virtuals[c];
|
||||||
}))), asmjit::FuncSignature2<void*, void*, int>());
|
}))), asmjit::FuncSignature2<void*, void*, int>());
|
||||||
call->setRet(0, result);
|
call->setRet(0, regA[A]);
|
||||||
call->setArg(0, regA[A]);
|
call->setArg(0, regA[B]);
|
||||||
call->setArg(1, asmjit::Imm(C));
|
call->setArg(1, asmjit::Imm(C));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue