diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 51c995eef..103ddfe19 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -942,7 +942,7 @@ static void setTokenValue(Token* tok, if (Token::simpleMatch(parent, "-") && value2.bound == result.bound && value2.bound != ValueFlow::Value::Bound::Point) result.invertBound(); - setTokenValue(parent, result, settings); + setTokenValue(parent, result, settings, isInitList); } } } @@ -1363,7 +1363,7 @@ static void valueFlowNumber(TokenList *tokenlist, const Settings* settings) bool isInitList = false; const Token* endInit{}; for (Token *tok = tokenlist->front(); tok;) { - if (!isInitList && tok->str() == "{" && Token::simpleMatch(tok->astOperand1(), ",")) { + if (!isInitList && tok->str() == "{" && (Token::simpleMatch(tok->astOperand1(), ",") || Token::simpleMatch(tok->astOperand2(), ","))) { isInitList = true; endInit = tok->link(); }