Fixed crash when checking tinyxml introduced by previous commit
This commit is contained in:
parent
20753f4697
commit
780719665f
|
@ -423,16 +423,16 @@ void CheckOther::clarifyStatement()
|
||||||
for (std::size_t i = 0; i < functions; ++i) {
|
for (std::size_t i = 0; i < functions; ++i) {
|
||||||
const Scope * scope = symbolDatabase->functionScopes[i];
|
const Scope * scope = symbolDatabase->functionScopes[i];
|
||||||
for (const Token* tok = scope->classStart; tok && tok != scope->classEnd; tok = tok->next()) {
|
for (const Token* tok = scope->classStart; tok && tok != scope->classEnd; tok = tok->next()) {
|
||||||
if (Token::Match(tok, "* %var%")) {
|
if (Token::Match(tok, "* %var%") && tok->astOperand1()) {
|
||||||
const Token *tok2=tok->previous();
|
const Token *tok2=tok->previous();
|
||||||
|
|
||||||
while (tok2 && tok2->str() == "*")
|
while (tok2 && tok2->str() == "*")
|
||||||
tok2=tok2->previous();
|
tok2 = tok2->previous();
|
||||||
|
|
||||||
if (Token::Match(tok2, "[{};]")) {
|
if (Token::Match(tok2, "[{};]")) {
|
||||||
tok = tok->astOperand1();
|
tok2 = tok->astOperand1();
|
||||||
if (Token::Match(tok, "++|-- [;,]"))
|
if (Token::Match(tok2, "++|-- [;,]"))
|
||||||
clarifyStatementError(tok);
|
clarifyStatementError(tok2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue