Add regression test for 7013: valueFlowAfterCondition: false positive below overspecified code (#3055)
This commit is contained in:
parent
dd866f2898
commit
65395aeaa1
|
@ -2591,6 +2591,16 @@ private:
|
|||
"}\n";
|
||||
ASSERT_EQUALS(false, testValueOfXImpossible(code, 10U, 1));
|
||||
ASSERT_EQUALS(false, testValueOfXKnown(code, 10U, 0));
|
||||
|
||||
code = "int f(int a, int b) {\n"
|
||||
" if (!a && !b)\n"
|
||||
" return;\n"
|
||||
" if ((!a && b) || (a && !b))\n"
|
||||
" return;\n"
|
||||
" int x = a;\n" // <- a is _not_ 0
|
||||
" return x;\n"
|
||||
"}\n";
|
||||
ASSERT_EQUALS(false, testValueOfX(code, 7U, 0));
|
||||
}
|
||||
|
||||
void valueFlowAfterConditionExpr() {
|
||||
|
|
Loading…
Reference in New Issue