Skip to content

Fix #12775 FP containerOutOfBounds with push_back() in loop#6451

Merged
chrchr-github merged 26 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_12775
Jun 8, 2024
Merged

Fix #12775 FP containerOutOfBounds with push_back() in loop#6451
chrchr-github merged 26 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_12775

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

@chrchr-github chrchr-github marked this pull request as ready for review May 27, 2024 21:14
@chrchr-github chrchr-github marked this pull request as draft May 28, 2024 08:12
@chrchr-github chrchr-github reopened this May 28, 2024
@chrchr-github chrchr-github marked this pull request as ready for review May 28, 2024 14:42
@chrchr-github
Copy link
Copy Markdown
Collaborator Author

@danmar Any feedback?
cppcheck-premium had a couple FPs on template code and one true positive, so I disabled it for now. Not sure why the warnings were triggered, since I didn't change the affected code.

lib/astutils.h:69:16: style: Variable 't2' can be declared as pointer to const [constVariablePointer]
            T *t2 = tok->astOperand2();
               ^
lib/astutils.h:74:16: style: Variable 't1' can be declared as pointer to const [constVariablePointer]
            T *t1 = tok->astOperand1();
               ^
lib/findtoken.h:59:45: style: Parameter 'tok' can be declared as pointer to const [constParameterPointer]
    findTokensImpl(start, end, pred, [&](T* tok) {
                                            ^
lib/findtoken.h:184:16: style: Parameter 'tok' can be declared as pointer to const [constParameterPointer]
        [&](T* tok) {
               ^
lib/templatesimplifier.cpp:2188:25: style: Variable 'tok2' can be declared as pointer to const [constVariablePointer]
                Token * tok2 = findTemplateDeclarationEnd(tok3);

@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Ping @danmar

1 similar comment
@chrchr-github
Copy link
Copy Markdown
Collaborator Author

Ping @danmar

@chrchr-github chrchr-github merged commit dc385f3 into cppcheck-opensource:main Jun 8, 2024
@chrchr-github chrchr-github deleted the chr_12775 branch June 8, 2024 20:36
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.

1 participant