Skip to content

Partial fix for #15048 (conditional containerOutOfBounds) - #8881

Open
chrchr-github wants to merge 1 commit into
cppcheck-opensource:mainfrom
chrchr-github:chr_15048_I
Open

chrchr-github wants to merge 1 commit into
cppcheck-opensource:mainfrom
chrchr-github:chr_15048_I

Conversation

@chrchr-github

Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread test/teststl.cpp
" return v;\n"
"}\n");
ASSERT_EQUALS("[test.cpp:4:10]: error: Out of bounds access in 'v[i]', if 'v' size is 10 and 'i' is 10 [containerOutOfBounds]\n",
ASSERT_EQUALS("[test.cpp:4:10]: warning: Out of bounds access in 'v[i]', if 'v' size is 10 and 'i' is 10 [containerOutOfBounds]\n",

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This looks like a ValueFlow issue, even known loop iterations have conditional values.

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