#6505 ValueFlow: handle 2 related if in valueFlowSubFunction. Regression test. Bug got fixed before
This commit is contained in:
parent
4400f2ac85
commit
0b96b9d984
|
@ -92,6 +92,7 @@ private:
|
|||
TEST_CASE(functioncalllibrary); // use Library to parse function call
|
||||
TEST_CASE(functioncallDefaultArguments);
|
||||
TEST_CASE(nullpointer_internal_error); // #5080
|
||||
TEST_CASE(ticket6505);
|
||||
}
|
||||
|
||||
void check(const char code[], bool inconclusive = false, const char filename[] = "test.cpp") {
|
||||
|
@ -2443,6 +2444,22 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void ticket6505() {
|
||||
check("void foo(MythSocket *socket) {\n"
|
||||
" bool do_write=false;\n"
|
||||
" if (socket) {\n"
|
||||
" do_write=something();\n"
|
||||
" }\n"
|
||||
" if (do_write) {\n"
|
||||
" socket->func();\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
"void bar() {\n"
|
||||
" foo(0);\n"
|
||||
"}\n", true, "test.c");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
};
|
||||
|
||||
REGISTER_TEST(TestNullPointer)
|
||||
|
|
Loading…
Reference in New Issue