Skip to content

Fix #6492 valueflow: for loop condition not used for conditional analysis#8472

Open
chrchr-github wants to merge 13 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_6492
Open

Fix #6492 valueflow: for loop condition not used for conditional analysis#8472
chrchr-github wants to merge 13 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_6492

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

@chrchr-github chrchr-github commented Apr 21, 2026

To be merged after #8471.
Ignoring the debug messages since the line numbers were flaky.

@sonarqubecloud
Copy link
Copy Markdown

@chrchr-github chrchr-github marked this pull request as ready for review April 25, 2026 17:26
Comment thread lib/valueflow.cpp Outdated
if (const Token* parent = tok->astParent()) {
if (Token::Match(parent, "%oror%|&&|?") ||
Token::Match(parent->previous(), "if|while (") ||
(parent->str() == ";" && Token::simpleMatch(parent->astParent(), ";"))) {
Copy link
Copy Markdown
Collaborator

@danmar danmar Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if parent is ; we also should check that tok is the LHS of parent right? (astIsLHS).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants