You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for (const Token* tok2 = tok->tokAt(2); tok2; tok2 = tok2->next()) { // Ensure that variable isn't used on right side of =, too
@@ -1829,23 +1829,23 @@ bool CheckOther::checkInnerScope(const Token *tok, const Variable* var, bool& us
1829
1829
indent--;
1830
1830
} elseif (tok2->str() == ";")
1831
1831
break;
1832
-
elseif (tok2->varId() == var->varId()) {
1832
+
elseif (tok2->varId() == var->declarationId()) {
1833
1833
loopVariable = true;
1834
1834
break;
1835
1835
}
1836
1836
}
1837
1837
}
1838
1838
1839
-
if (loopVariable && Token::Match(tok, "%varid% !!=", var->varId())) // Variable used in loop
1839
+
if (loopVariable && Token::Match(tok, "%varid% !!=", var->declarationId())) // Variable used in loop
1840
1840
returnfalse;
1841
1841
1842
-
if (Token::Match(tok, "& %varid%", var->varId())) // Taking address of variable
1842
+
if (Token::Match(tok, "& %varid%", var->declarationId())) // Taking address of variable
1843
1843
returnfalse;
1844
1844
1845
-
if (Token::Match(tok, "= %varid%", var->varId()) && (var->isArray() || var->isPointer())) // Create a copy of array/pointer. Bailout, because the memory it points to might be necessary in outer scope
1845
+
if (Token::Match(tok, "= %varid%", var->declarationId()) && (var->isArray() || var->isPointer())) // Create a copy of array/pointer. Bailout, because the memory it points to might be necessary in outer scope
1846
1846
returnfalse;
1847
1847
1848
-
if (tok->varId() == var->varId()) {
1848
+
if (tok->varId() == var->declarationId()) {
1849
1849
used = true;
1850
1850
if (scope->type == Scope::eSwitch && scope == tok->scope())
1851
1851
returnfalse; // Used in outer switch scope - unsafe or impossible to reduce scope
@@ -420,7 +420,7 @@ class UninitVar : public ExecutionPath {
420
420
while (parent) {
421
421
for (std::list<Variable>::const_iterator j = parent->varlist.begin(); j != parent->varlist.end(); ++j) {
422
422
if (j->name() == var2->name()) {
423
-
ExecutionPath::bailOutVar(checks, j->varId()); // If there is a variable with the same name in other scopes, this might cause false positives, if there are unexpanded macros
423
+
ExecutionPath::bailOutVar(checks, j->declarationId()); // If there is a variable with the same name in other scopes, this might cause false positives, if there are unexpanded macros
0 commit comments