ValueFlow::setTokenValue: Don't calculate parent value for uninitialized values

This commit is contained in:
Daniel Marjamäki 2017-04-23 21:58:01 +02:00
parent 2f51b975ed
commit a688402617
1 changed files with 4 additions and 0 deletions

View File

@ -256,6 +256,10 @@ static void setTokenValue(Token* tok, const ValueFlow::Value &value, const Setti
if (!tok->addValue(value))
return;
// Don't set parent for uninitialized values
if (value.isUninit())
return;
Token *parent = const_cast<Token*>(tok->astParent());
if (!parent)
return;