jonas054: fixed #807 (cppcheck crashes scanning ruby 1.9.1)

This commit is contained in:
Daniel Marjamäki 2009-10-09 17:28:23 +02:00
parent 6923a09001
commit dbfba8c2a6
1 changed files with 1 additions and 1 deletions

View File

@ -3188,7 +3188,7 @@ bool Tokenizer::simplifyKnownVariables()
{ {
const Token *endpar = tok3->next()->link(); const Token *endpar = tok3->next()->link();
bool bailout = false; bool bailout = false;
for (const Token *tok4 = tok3; tok4 != endpar; tok4 = tok4->next()) for (const Token *tok4 = tok3; tok4 && tok4 != endpar; tok4 = tok4->next())
{ {
if (Token::Match(tok4, "++|-- %varid%", varid) || if (Token::Match(tok4, "++|-- %varid%", varid) ||
Token::Match(tok4, "%varid% ++|--", varid)) Token::Match(tok4, "%varid% ++|--", varid))