value flow: fixed segfault when checking lib/mathlib.cpp

This commit is contained in:
Daniel Marjamäki 2014-01-04 21:28:15 +01:00
parent 45278eadc7
commit 9fabc7991a
1 changed files with 1 additions and 1 deletions

View File

@ -25,7 +25,7 @@ static void valueFlowBeforeCondition(Token *tokens)
for (Token *tok = tokens; tok; tok = tok->next()) {
unsigned int varid;
MathLib::bigint num;
if (Token::Match(tok, "==|!=|>=|<=") && tok->astOperand2()) {
if (Token::Match(tok, "==|!=|>=|<=") && tok->astOperand1() && tok->astOperand2()) {
if (tok->astOperand1()->isName() && tok->astOperand2()->isNumber()) {
varid = tok->astOperand1()->varId();
num = MathLib::toLongNumber(tok->astOperand2()->str());