- fixed code generation for dummy results.

This commit is contained in:
Christoph Oelckers 2018-11-29 20:15:53 +01:00
parent ef2c433a8b
commit 19df662348

View file

@ -1068,16 +1068,17 @@ ExpEmit FunctionCallEmitter::EmitCall(VMFunctionBuilder *build, TArray<ExpEmit>
} }
if (virtualselfreg == -1) if (virtualselfreg == -1)
{ {
build->Emit(OP_CALL_K, build->GetConstantAddress(target), paramcount, returns.Size()); build->Emit(OP_CALL_K, build->GetConstantAddress(target), paramcount, vm_jit ? target->Proto->ReturnTypes.Size() : returns.Size());
} }
else else
{ {
ExpEmit funcreg(build, REGT_POINTER); ExpEmit funcreg(build, REGT_POINTER);
build->Emit(OP_VTBL, funcreg.RegNum, virtualselfreg, target->VirtualIndex); build->Emit(OP_VTBL, funcreg.RegNum, virtualselfreg, target->VirtualIndex);
build->Emit(OP_CALL, funcreg.RegNum, paramcount, returns.Size()); build->Emit(OP_CALL, funcreg.RegNum, paramcount, vm_jit? target->Proto->ReturnTypes.Size() : returns.Size());
} }
assert(returns.Size() < 2 || ReturnRegs != nullptr); assert(returns.Size() < 2 || ReturnRegs != nullptr);