Code fix. Used wrong variable in condition, leading to segfaults.

This commit is contained in:
Daniel Marjamäki 2015-12-26 01:52:43 +01:00
parent 293bd2eead
commit cea40168e0
1 changed files with 1 additions and 1 deletions

View File

@ -96,7 +96,7 @@ void CheckFunctions::invalidFunctionUsage()
while (top->astParent() && top->astParent()->str() != "," && top->astParent() != tok->next())
top = top->astParent();
const Token *var = top;
while (Token::Match(top, ".|::"))
while (Token::Match(var, ".|::"))
var = var->astOperand2();
if (Token::Match(top, "%comp%|%oror%|&&|!|true|false") ||
(var && var->variable() && Token::Match(var->variable()->typeStartToken(), "bool"))) {