ValueFlow: inherit Value::callstack in calculations

This commit is contained in:
Daniel Marjamäki 2017-05-16 19:43:55 +02:00
parent f92e7b3bfc
commit e65d6d3c67
1 changed files with 1 additions and 0 deletions

View File

@ -365,6 +365,7 @@ static void setTokenValue(Token* tok, const ValueFlow::Value &value, const Setti
result.inconclusive = value1->inconclusive | value2->inconclusive; result.inconclusive = value1->inconclusive | value2->inconclusive;
result.varId = (value1->varId != 0U) ? value1->varId : value2->varId; result.varId = (value1->varId != 0U) ? value1->varId : value2->varId;
result.varvalue = (result.varId == value1->varId) ? value1->varvalue : value2->varvalue; result.varvalue = (result.varId == value1->varId) ? value1->varvalue : value2->varvalue;
result.callstack = (value1->callstack.empty() ? value2 : value1)->callstack;
if (value1->valueKind == value2->valueKind) if (value1->valueKind == value2->valueKind)
result.valueKind = value1->valueKind; result.valueKind = value1->valueKind;
const float floatValue1 = value1->isIntValue() ? value1->intvalue : value1->floatValue; const float floatValue1 = value1->isIntValue() ? value1->intvalue : value1->floatValue;