Skip to content

Fix #10151 FP eraseDereference when returning iterator from loop#3787

Merged
danmar merged 2 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix10151
Feb 3, 2022
Merged

Fix #10151 FP eraseDereference when returning iterator from loop#3787
danmar merged 2 commits intocppcheck-opensource:mainfrom
chrchr-github:chr_Fix10151

Conversation

@chrchr-github
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread lib/checkstl.cpp Outdated
if (isVector(tok->tokAt(-3)))
continue;
if (Token::simpleMatch(tok->astParent(), "="))
if (Token::simpleMatch(tok->astParent(), "=") || Token::simpleMatch(tok->astParent(), "return"))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Token::Match(tok->astParent(), "=|return")

@danmar danmar merged commit 17b5382 into cppcheck-opensource:main Feb 3, 2022
@chrchr-github chrchr-github deleted the chr_Fix10151 branch April 6, 2022 13:38
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