Skip to content
Permalink
Browse files

- do not accept read-only variable as out argument

  • Loading branch information...
alexey-lysiuk committed Oct 22, 2019
1 parent 9a727f6 commit 94e7b6f3b5fc1efc48506229426f7067eb28213a
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/scripting/backend/codegen.cpp
@@ -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);
}

0 comments on commit 94e7b6f

Please sign in to comment.
You can’t perform that action at this time.