Fix possible null pointer dereference

This commit is contained in:
Richard Quirk 2011-12-01 19:50:26 +01:00
parent b2ea78543b
commit d2c8b9be56
1 changed files with 3 additions and 1 deletions

View File

@ -2415,11 +2415,13 @@ namespace {
if (tok != start && tok->str() == "(") {
// go back to find the function call.
const Token *prev = tok->previous();
if (!prev)
continue;
if (prev->str() == ">") {
// ignore template functions like boo<double>()
return true;
}
if (prev && prev->isName()) {
if (prev->isName()) {
const Variable *v = 0;
if (Token::Match(prev->tokAt(-2), "%var% .")) {
const Token *scope = prev->tokAt(-2);