Fix missing error when accessing unintialized variables.

This commit is contained in:
Mathias Baumann
2021-01-25 14:44:15 +01:00
parent ccdf57c9b1
commit 07a1d230cd
7 changed files with 61 additions and 1 deletions
+4 -1
View File
@@ -110,7 +110,10 @@ void ControlFlowAnalyzer::checkUninitializedAccess(CFGNode const* _entry, CFGNod
// Propagate changes to all exits and queue them for traversal, if needed.
for (auto const& exit: currentNode->exits)
if (nodeInfos[exit].propagateFrom(nodeInfo))
if (
auto exists = valueOrNullptr(nodeInfos, exit);
nodeInfos[exit].propagateFrom(nodeInfo) || !exists
)
nodesToTraverse.insert(exit);
}