diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 3af62b87e40..b1ba4fe0585 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -7258,7 +7258,8 @@ struct MultiValueFlowAnalyzer : ValueFlowAnalyzer { } bool stopOnCondition(const Token* /*condTok*/) const override { - return isConditional(); + // TODO fix false negatives + return true; // isConditional(); } bool updateScope(const Token* endBlock, bool /*modified*/) const override { diff --git a/test/teststl.cpp b/test/teststl.cpp index 5b1b7a65fd8..f81bea7d698 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -2386,11 +2386,12 @@ class TestStl : public TestFixture { "void g(const std::vector& w) {\n" " f(-1, w);\n" "}\n"); - ASSERT_EQUALS("test.cpp:5:warning:Array index -1 is out of bounds.\n" - "test.cpp:8:note:Calling function 'f', 1st argument '-1' value is -1\n" - "test.cpp:3:note:Assuming condition is false\n" - "test.cpp:5:note:Negative array index\n", - errout.str()); + TODO_ASSERT_EQUALS("test.cpp:5:warning:Array index -1 is out of bounds.\n" + "test.cpp:8:note:Calling function 'f', 1st argument '-1' value is -1\n" + "test.cpp:3:note:Assuming condition is false\n" + "test.cpp:5:note:Negative array index\n", + "", + errout.str()); settings = oldSettings; } diff --git a/test/testuninitvar.cpp b/test/testuninitvar.cpp index 66ad966b790..f13536c1c0d 100644 --- a/test/testuninitvar.cpp +++ b/test/testuninitvar.cpp @@ -6490,7 +6490,7 @@ class TestUninitVar : public TestFixture { " bool copied_all = true;\n" " g(&copied_all, 5, 6, &bytesCopied);\n" "}"); - ASSERT_EQUALS("[test.cpp:7] -> [test.cpp:2]: (warning) Uninitialized variable: *buflen\n", errout.str()); + TODO_ASSERT_EQUALS("[test.cpp:7] -> [test.cpp:2]: (warning) Uninitialized variable: *buflen\n", "", errout.str()); // # 9953 valueFlowUninit("uint32_t f(uint8_t *mem) {\n" diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index 3e4fe4e9939..b0ad19d3d33 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -4517,7 +4517,7 @@ class TestValueFlow : public TestFixture { "void f(Object *obj) {\n" " if (valid(obj, K0)) {}\n" "}\n"; - ASSERT_EQUALS(true, testValueOfX(code, 7U, 0)); + TODO_ASSERT_EQUALS(true, false, testValueOfX(code, 7U, 0)); ASSERT_EQUALS(false, testValueOfXKnown(code, 7U, 0)); code = "int f(int i) {\n"