Fixed #2132 (Internal error. Token::Match called with varid 0.)

This commit is contained in:
Daniel Marjamäki 2010-10-26 18:10:03 +02:00
parent 27235f27ae
commit b6106ddf72
1 changed files with 1 additions and 0 deletions

View File

@ -1179,6 +1179,7 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
}
else if (indentlevel > 0 &&
Token::Match(tok, "[;{}] %var% = %str% ;") &&
tok->next()->varId() > 0 &&
NULL != Token::findmatch(_tokenizer->tokens(), "[;{}] const| %type% * %varid% ;", tok->next()->varId()))
{
size = 1 + int(tok->tokAt(3)->strValue().size());