Bugfix and tests.

Co-authored-by: Kamil Śliwak <kamil.sliwak@codepoets.it>
This commit is contained in:
Daniel Kirchner
2022-09-08 11:54:14 +02:00
co-authored by Kamil Śliwak
parent d5e2925326
commit a33da17300
7 changed files with 164 additions and 2 deletions
+4 -1
View File
@@ -105,10 +105,13 @@ void UnusedStoreEliminator::operator()(FunctionCall const& _functionCall)
else
sideEffects = m_controlFlowSideEffects.at(_functionCall.functionName.name);
if (sideEffects.canTerminate)
changeUndecidedTo(State::Used, Location::Storage);
if (!sideEffects.canContinue)
{
changeUndecidedTo(State::Unused, Location::Memory);
changeUndecidedTo(sideEffects.canTerminate ? State::Used : State::Unused, Location::Storage);
if (!sideEffects.canTerminate)
changeUndecidedTo(State::Unused, Location::Storage);
}
}