- fixed: FxVMFunctionCall::GetDirectFunction did not check if the function could be called with no arguments.

This commit is contained in:
Christoph Oelckers 2016-11-19 12:22:58 +01:00
parent f11f020b6c
commit 9fab8380ff

View file

@ -7066,6 +7066,8 @@ VMFunction *FxVMFunctionCall::GetDirectFunction()
// it inside VM code.
if (ArgList.Size() == 0 && !(Function->Variants[0].Flags & VARF_Virtual))
{
unsigned imp = Function->GetImplicitArgs();
if (Function->Variants[0].ArgFlags.Size() <= imp || !(Function->Variants[0].ArgFlags[imp] & VARF_Optional)) return nullptr;
return Function->Variants[0].Implementation;
}