- do not accept read-only variable as out argument

https://forum.zdoom.org/viewtopic.php?t=66179
This commit is contained in:
alexey.lysiuk 2019-10-22 11:11:22 +03:00
parent 9a727f6c2f
commit 94e7b6f3b5

View file

@ -9047,6 +9047,14 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
else else
{ {
ArgList[i]->RequestAddress(ctx, &writable); ArgList[i]->RequestAddress(ctx, &writable);
if ((flag & VARF_Out) && !writable)
{
ScriptPosition.Message(MSG_ERROR, "Argument must be a modifiable value");
delete this;
return nullptr;
}
if (flag & VARF_Ref)ArgList[i]->ValueType = NewPointer(ArgList[i]->ValueType); if (flag & VARF_Ref)ArgList[i]->ValueType = NewPointer(ArgList[i]->ValueType);
} }