From 40a348b1f1b88b1918b771a5baf2e47849079c60 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 27 Oct 2017 18:15:24 +0300 Subject: [PATCH] Fixed potential crash in resolving of multiple assignment https://forum.zdoom.org/viewtopic.php?t=58055 https://forum.zdoom.org/viewtopic.php?t=58237 --- src/scripting/backend/codegen.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 249537aaa1..5642402034 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -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;