Fix #12406 FP containerOutOfBounds with reassigned vector#5982
Fix #12406 FP containerOutOfBounds with reassigned vector#5982chrchr-github wants to merge 3 commits into
Conversation
|
@pfultz2 Any comments? |
|
I dont think this is a good idea. This just completely bypasses using the Also adding asserts should prevent FPs not introduce FPs as well. |
|
The fix prevents mixing values from different containers ( Adding the |
It bypasses using
No is not for the wrong reasons. It works because we assume the assert is true: https://github.com/danmar/cppcheck/blob/main/lib/forwardanalyzer.cpp#L805 This allows users to add asserts to reduce FPs. With this change, it is no longer possible since we wont use |
|
Also, this issue seems like there is a problem with
That is a seperate issue. I think we need a |
Yeah, I don't understand what's going on in |
Maybe trading one FP for another can be avoided somehow.
Without the
assert, we already have an FP (tracked in https://trac.cppcheck.net/ticket/10322).