Skip to content

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

Open
pfultz2 wants to merge 7 commits into
cppcheck-opensource:mainfrom
pfultz2:valueflow-stop-on-condition-dependent
Open

Fix issue 13682: false negative: nullPointerRedundantCheck (multiple conditions, regression)#8669
pfultz2 wants to merge 7 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())
                                                                     ^

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.

2 participants