From 31bd7cfc0441bff1c6899d2b6c8e2ed180cca067 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 18 Aug 2018 15:20:38 +0300 Subject: [PATCH] - prohibit assignment of dynamic arrays https://forum.zdoom.org/viewtopic.php?t=61682 --- src/scripting/backend/codegen.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 75f04d421..b98b2ae24 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -2480,6 +2480,12 @@ FxExpression *FxAssign::Resolve(FCompileContext &ctx) delete this; return nullptr; } + else if (Base->IsDynamicArray()) + { + ScriptPosition.Message(MSG_ERROR, "Cannot assign dymanic arrays, use Copy() or Move() function instead"); + delete this; + return nullptr; + } if (!Base->IsVector() && Base->ValueType->isStruct()) { ScriptPosition.Message(MSG_ERROR, "Struct assignment not implemented yet");