Skip to content

Commit 120c30a

Browse files
Update valueflow.cpp
1 parent 1f72150 commit 120c30a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

lib/valueflow.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5958,9 +5958,12 @@ static Token* findStartToken(const Variable* var, Token* start, const Library& l
59585958
}))
59595959
return first->previous();
59605960
// Compute the outer scope
5961-
while (scope && scope->nestedIn != var->scope())
5961+
while (scope && scope->nestedIn != var->scope()) {
5962+
if (scope->type == ScopeType::eLambda && !Token::simpleMatch(scope->bodyEnd, "} ("))
5963+
return start;
59625964
scope = scope->nestedIn;
5963-
if (!scope)
5965+
}
5966+
if (!scope || (scope->type == ScopeType::eLambda && !Token::simpleMatch(scope->bodyEnd, "} (")))
59645967
return start;
59655968
auto* tok = const_cast<Token*>(scope->bodyStart);
59665969
if (!tok)

0 commit comments

Comments
 (0)