- fixed: Do not allow empty function arguments pass. For unknown reasons the grammar accepts them as valid, so this needs to be checked when resolving them.

This commit is contained in:
Christoph Oelckers 2016-11-25 16:35:07 +01:00
parent 8dba322775
commit 53ff7f0c73

View file

@ -6820,6 +6820,16 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx)
ABORT(ctx.Class);
bool error = false;
for (auto a : ArgList)
{
if (a == nullptr)
{
ScriptPosition.Message(MSG_ERROR, "Empty function argument.");
delete this;
return nullptr;
}
}
PFunction *afd = FindClassMemberFunction(ctx.Class, ctx.Class, MethodName, ScriptPosition, &error);
if (afd != nullptr)
@ -7071,6 +7081,16 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx)
PClass *ccls = nullptr;
for (auto a : ArgList)
{
if (a == nullptr)
{
ScriptPosition.Message(MSG_ERROR, "Empty function argument.");
delete this;
return nullptr;
}
}
if (Self->ExprType == EFX_Identifier)
{
ccls = PClass::FindClass(static_cast<FxIdentifier *>(Self)->Identifier);