Tokenizer: Refactoring the simplifyKnownVariable

This commit is contained in:
Daniel Marjamäki 2010-11-06 20:23:49 +01:00
parent 5be12a1d27
commit 2833a5ebb5
1 changed files with 4 additions and 5 deletions

View File

@ -5973,15 +5973,14 @@ bool Tokenizer::simplifyKnownVariables()
// Variable is used somehow in a non-defined pattern => bail out // Variable is used somehow in a non-defined pattern => bail out
if (tok3->varId() == varid) if (tok3->varId() == varid)
{ {
// calling member function.. bail out because this might
// have different effects to the variable.
if (Token::Match(tok3->next(), ". %var% ("))
break;
// This is a really generic bailout so let's try to avoid this. // This is a really generic bailout so let's try to avoid this.
// There might be lots of false negatives. // There might be lots of false negatives.
if (_settings && _settings->debugwarnings) if (_settings && _settings->debugwarnings)
{ {
// suppress debug-warning when calling member function
if (Token::Match(tok3->next(), ". %var% ("))
break;
std::list<ErrorLogger::ErrorMessage::FileLocation> locationList; std::list<ErrorLogger::ErrorMessage::FileLocation> locationList;
ErrorLogger::ErrorMessage::FileLocation loc; ErrorLogger::ErrorMessage::FileLocation loc;
loc.line = tok3->linenr(); loc.line = tok3->linenr();