Repository navigation
Commit 4b66976
authored
Fix 15042: ValueFlow: conditionally reassigned value should not be known (cppcheck-opensource#8899)
This refactors `ProgramMemory` so it can store a list of values.
A condition such as `x > 3` was recorded as the possible value 4 with a lower bound, and the executor then used it as if `x` were exactly 4. Nested conditions were decided wrongly, so branches were skipped and values leaked past or were lost before them. This what lead to the FP in 15042.
Now it can understand these constraints better. As new values are added, it is resolved similar to `Token::addValue`.1 parent 7b481f4 commit 4b66976
33 files changed
Lines changed: 2288 additions & 5180 deletions
File tree
- gui
- lib
- oss-fuzz
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
646 | 646 | | |
647 | 647 | | |
648 | 648 | | |
649 | | - | |
| 649 | + | |
650 | 650 | | |
651 | 651 | | |
652 | 652 | | |
| |||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
0 commit comments