value flow: fix segfault if var is null

This commit is contained in:
Daniel Marjamäki 2014-01-10 18:30:41 +01:00
parent c687933e9f
commit 57d241793f
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ static void valueFlowBeforeCondition(TokenList *tokenlist, ErrorLogger *errorLog
} else { } else {
tok2 = tok2->link(); tok2 = tok2->link();
} }
} else if (var->isGlobal() && tok2->str() == "{") { } else if (var && var->isGlobal() && tok2->str() == "{") {
if (!Token::Match(tok2->previous(), ")|else {")) if (!Token::Match(tok2->previous(), ")|else {"))
break; break;
if (Token::Match(tok2->previous(), ") {") && if (Token::Match(tok2->previous(), ") {") &&