Static Analyzer: Fix non-deterministic order of unused variable warnings.

This commit is contained in:
Daniel Kirchner
2018-04-06 18:10:26 +02:00
parent 9bd49516d8
commit b2753aa053
3 changed files with 11 additions and 8 deletions
+3 -1
View File
@@ -77,7 +77,9 @@ private:
bool m_nonPayablePublic = false;
/// Number of uses of each (named) local variable in a function, counter is initialized with zero.
std::map<VariableDeclaration const*, int> m_localVarUseCount;
/// Pairs of AST ids and pointers are used as keys to ensure a deterministic order
/// when traversing.
std::map<std::pair<size_t, VariableDeclaration const*>, int> m_localVarUseCount;
FunctionDefinition const* m_currentFunction = nullptr;