alexey.lysiuk 2019-10-22 10:40:45 +03:00
parent 4fa6678fc5
commit 9a727f6c2f

View file

@ -11292,14 +11292,6 @@ FxExpression *FxLocalVariableDeclaration::Resolve(FCompileContext &ctx)
{
CHECKRESOLVED();
if (IsDynamicArray())
{
auto stackVar = new FxStackVariable(ValueType, StackOffset, ScriptPosition);
FArgumentList argsList;
clearExpr = new FxMemberFunctionCall(stackVar, "Clear", argsList, ScriptPosition);
SAFE_RESOLVE(clearExpr, ctx);
}
if (ctx.Block == nullptr)
{
ScriptPosition.Message(MSG_ERROR, "Variable declaration outside compound statement");
@ -11356,6 +11348,15 @@ FxExpression *FxLocalVariableDeclaration::Resolve(FCompileContext &ctx)
}
}
}
if (IsDynamicArray())
{
auto stackVar = new FxStackVariable(ValueType, StackOffset, ScriptPosition);
FArgumentList argsList;
clearExpr = new FxMemberFunctionCall(stackVar, "Clear", argsList, ScriptPosition);
SAFE_RESOLVE(clearExpr, ctx);
}
ctx.Block->LocalVars.Push(this);
return this;
}