Fixed #2132 (Internal error. Token::Match called with varid 0.)
This commit is contained in:
parent
27235f27ae
commit
b6106ddf72
|
@ -1179,6 +1179,7 @@ void CheckBufferOverrun::checkGlobalAndLocalVariable()
|
||||||
}
|
}
|
||||||
else if (indentlevel > 0 &&
|
else if (indentlevel > 0 &&
|
||||||
Token::Match(tok, "[;{}] %var% = %str% ;") &&
|
Token::Match(tok, "[;{}] %var% = %str% ;") &&
|
||||||
|
tok->next()->varId() > 0 &&
|
||||||
NULL != Token::findmatch(_tokenizer->tokens(), "[;{}] const| %type% * %varid% ;", tok->next()->varId()))
|
NULL != Token::findmatch(_tokenizer->tokens(), "[;{}] const| %type% * %varid% ;", tok->next()->varId()))
|
||||||
{
|
{
|
||||||
size = 1 + int(tok->tokAt(3)->strValue().size());
|
size = 1 + int(tok->tokAt(3)->strValue().size());
|
||||||
|
|
Loading…
Reference in New Issue