Fix possible null pointer dereference
This commit is contained in:
parent
b2ea78543b
commit
d2c8b9be56
|
@ -2415,11 +2415,13 @@ namespace {
|
||||||
if (tok != start && tok->str() == "(") {
|
if (tok != start && tok->str() == "(") {
|
||||||
// go back to find the function call.
|
// go back to find the function call.
|
||||||
const Token *prev = tok->previous();
|
const Token *prev = tok->previous();
|
||||||
|
if (!prev)
|
||||||
|
continue;
|
||||||
if (prev->str() == ">") {
|
if (prev->str() == ">") {
|
||||||
// ignore template functions like boo<double>()
|
// ignore template functions like boo<double>()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (prev && prev->isName()) {
|
if (prev->isName()) {
|
||||||
const Variable *v = 0;
|
const Variable *v = 0;
|
||||||
if (Token::Match(prev->tokAt(-2), "%var% .")) {
|
if (Token::Match(prev->tokAt(-2), "%var% .")) {
|
||||||
const Token *scope = prev->tokAt(-2);
|
const Token *scope = prev->tokAt(-2);
|
||||||
|
|
Loading…
Reference in New Issue