Skip to content

Commit

Permalink
- do not accept read-only variable as out argument
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey-lysiuk committed Oct 22, 2019
1 parent 9a727f6 commit 94e7b6f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/scripting/backend/codegen.cpp
Expand Up @@ -9047,6 +9047,14 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
else
{
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);
}

Expand Down

0 comments on commit 94e7b6f

Please sign in to comment.