diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 1470fffc5..eba36f0a3 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -365,6 +365,7 @@ static void setTokenValue(Token* tok, const ValueFlow::Value &value, const Setti result.inconclusive = value1->inconclusive | value2->inconclusive; result.varId = (value1->varId != 0U) ? value1->varId : value2->varId; result.varvalue = (result.varId == value1->varId) ? value1->varvalue : value2->varvalue; + result.callstack = (value1->callstack.empty() ? value2 : value1)->callstack; if (value1->valueKind == value2->valueKind) result.valueKind = value1->valueKind; const float floatValue1 = value1->isIntValue() ? value1->intvalue : value1->floatValue;