Fixed potential crash in resolving of multiple assignment

https://forum.zdoom.org/viewtopic.php?t=58055
https://forum.zdoom.org/viewtopic.php?t=58237
This commit is contained in:
alexey.lysiuk 2017-10-27 18:15:24 +03:00
parent 79bdfe4ab2
commit 40a348b1f1

View file

@ -2698,6 +2698,8 @@ FxExpression *FxMultiAssign::Resolve(FCompileContext &ctx)
auto varaccess = new FxLocalVariable(singlevar, ScriptPosition);
auto assignee = new FxTypeCast(varaccess, Base[i]->ValueType, false);
LocalVarContainer->Add(new FxAssign(Base[i], assignee, false));
// now temporary variable owns the current item
Base[i] = nullptr;
}
auto x = LocalVarContainer->Resolve(ctx);
LocalVarContainer = nullptr;