- report uninitialized variables once

This commit is contained in:
alexey.lysiuk 2019-06-02 12:48:26 +03:00
parent 5133f17da4
commit 9caa7da476

View file

@ -11357,6 +11357,8 @@ ExpEmit FxLocalVariableDeclaration::Emit(VMFunctionBuilder *build)
auto& registers = build->Registers[regType];
RegNum = registers.Get(RegCount);
bool useDirtyRegisters = false;
for (int reg = RegNum, end = RegNum + RegCount; reg < end; ++reg)
{
if (!registers.IsDirty(reg))
@ -11364,7 +11366,7 @@ ExpEmit FxLocalVariableDeclaration::Emit(VMFunctionBuilder *build)
continue;
}
ScriptPosition.Message(MSG_DEBUGMSG, "Implicit initialization of variable %s\n", Name.GetChars());
useDirtyRegisters = true;
switch (regType)
{
@ -11389,6 +11391,11 @@ ExpEmit FxLocalVariableDeclaration::Emit(VMFunctionBuilder *build)
break;
}
}
if (useDirtyRegisters)
{
ScriptPosition.Message(MSG_DEBUGMSG, "Implicit initialization of variable %s", Name.GetChars());
}
}
else
{