Skip to content

Fix issue 13682: false negative: nullPointerRedundantCheck (multiple conditions, regression)#8669

Merged
chrchr-github merged 12 commits into
cppcheck-opensource:mainfrom
pfultz2:valueflow-stop-on-condition-dependent
Jun 25, 2026
Merged

Fix issue 13682: false negative: nullPointerRedundantCheck (multiple conditions, regression)#8669
chrchr-github merged 12 commits into
cppcheck-opensource:mainfrom
pfultz2:valueflow-stop-on-condition-dependent

Conversation

@pfultz2

@pfultz2 pfultz2 commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@firewave

Copy link
Copy Markdown
Collaborator

Very nice.

The following ones are lacking the details but I do not think this needs to be fixed in the context of this PR and adding TODO tests and a ticket about this might be sufficient.

lib/checkstl.cpp:552:25: style: Condition 'containerToken' is always true [knownConditionTrueFalse]
                    if (containerToken && containerToken->variable() && containerToken->variable()->isReference()) {
                        ^
lib/checkcondition.cpp:458:70: style: Condition '!cond2->astOperand2()' is always false [knownConditionTrueFalse]
        if (!Token::Match(cond2, "&|==") || !cond2->astOperand1() || !cond2->astOperand2())
                                                                     ^

Comment thread externals/simplecpp/simplecpp.cpp
Your Name added 2 commits June 23, 2026 10:42
@pfultz2

pfultz2 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@chrchr-github @danmar Can you review?

@pfultz2 pfultz2 requested a review from firewave June 24, 2026 13:23
@chrchr-github chrchr-github merged commit 887b5d2 into cppcheck-opensource:main Jun 25, 2026
70 checks passed
@pfultz2 pfultz2 deleted the valueflow-stop-on-condition-dependent branch June 25, 2026 14:06
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