simplifyKnownVariables: fixed a segmentation fault

This commit is contained in:
Daniel Marjamäki 2008-12-21 09:12:00 +00:00
parent 7c3fbd7060
commit d44523144a
1 changed files with 1 additions and 4 deletions

View File

@ -1215,11 +1215,8 @@ bool Tokenizer::simplifyKnownVariables()
else if ( TOKEN::Match(tok2, "%var% = %num% ;") )
{
unsigned int varid = tok2->varId();
TOKEN *tok3 = tok2;
while ( tok3 )
for ( TOKEN *tok3 = tok2->next(); tok3; tok3 = tok3->next() )
{
tok3 = tok3->next();
// Perhaps it's a loop => bail out
if ( TOKEN::Match(tok3, "[{}]") )
break;