mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- Restricted argument count check to the void return case.
There were some issues here: * a check for mismatching count is too strict because it is legal to omit return values * it failed to detect returning multiple values in a single expression.
This commit is contained in:
parent
358001c306
commit
8c57447108
1 changed files with 1 additions and 1 deletions
|
@ -10640,7 +10640,7 @@ FxExpression *FxReturnStatement::Resolve(FCompileContext &ctx)
|
||||||
|
|
||||||
PPrototype *retproto;
|
PPrototype *retproto;
|
||||||
|
|
||||||
if (ctx.ReturnProto != nullptr && ctx.ReturnProto->ReturnTypes.Size() != Args.Size())
|
if (ctx.ReturnProto != nullptr && ctx.ReturnProto->ReturnTypes.Size() == 0 && ctx.ReturnProto->ReturnTypes.Size() != Args.Size())
|
||||||
{
|
{
|
||||||
int severity = ctx.Version >= MakeVersion(3, 7) ? MSG_ERROR : MSG_WARNING;
|
int severity = ctx.Version >= MakeVersion(3, 7) ? MSG_ERROR : MSG_WARNING;
|
||||||
ScriptPosition.Message(severity, "Incorrect number of return values. Got %u, but expected %u", Args.Size(), ctx.ReturnProto->ReturnTypes.Size());
|
ScriptPosition.Message(severity, "Incorrect number of return values. Got %u, but expected %u", Args.Size(), ctx.ReturnProto->ReturnTypes.Size());
|
||||||
|
|
Loading…
Reference in a new issue