mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 21:11:52 +00:00
- report uninitialized variables once
This commit is contained in:
parent
5133f17da4
commit
9caa7da476
1 changed files with 8 additions and 1 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue