mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-14 08:30:50 +00:00
- 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:
parent
8dba322775
commit
53ff7f0c73
1 changed files with 20 additions and 0 deletions
|
@ -6820,6 +6820,16 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx)
|
||||||
ABORT(ctx.Class);
|
ABORT(ctx.Class);
|
||||||
bool error = false;
|
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);
|
PFunction *afd = FindClassMemberFunction(ctx.Class, ctx.Class, MethodName, ScriptPosition, &error);
|
||||||
|
|
||||||
if (afd != nullptr)
|
if (afd != nullptr)
|
||||||
|
@ -7071,6 +7081,16 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx)
|
||||||
|
|
||||||
PClass *ccls = nullptr;
|
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)
|
if (Self->ExprType == EFX_Identifier)
|
||||||
{
|
{
|
||||||
ccls = PClass::FindClass(static_cast<FxIdentifier *>(Self)->Identifier);
|
ccls = PClass::FindClass(static_cast<FxIdentifier *>(Self)->Identifier);
|
||||||
|
|
Loading…
Reference in a new issue