Regression test for 8742: False positive: ValueFlow regression (#3444)
This commit is contained in:
parent
b788e41191
commit
2b7523e466
|
@ -120,6 +120,7 @@ private:
|
|||
TEST_CASE(nullpointer78); // #7802
|
||||
TEST_CASE(nullpointer79); // #10400
|
||||
TEST_CASE(nullpointer80); // #10410
|
||||
TEST_CASE(nullpointer81); // #8724
|
||||
TEST_CASE(nullpointer_addressOf); // address of
|
||||
TEST_CASE(nullpointerSwitch); // #2626
|
||||
TEST_CASE(nullpointer_cast); // #4692
|
||||
|
@ -2456,6 +2457,23 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void nullpointer81() // #8724
|
||||
{
|
||||
check("void f(A **list) {\n"
|
||||
" A *tmp_List = NULL;\n"
|
||||
" *list = NULL;\n"
|
||||
" while (1) {\n"
|
||||
" if (*list == NULL) {\n"
|
||||
" tmp_List = malloc (sizeof (ArchiveList_struct));\n"
|
||||
" *list = tmp_List;\n"
|
||||
" } else {\n"
|
||||
" tmp_List->next = malloc (sizeof (ArchiveList_struct));\n"
|
||||
" }\n"
|
||||
" }\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void nullpointer_addressOf() { // address of
|
||||
check("void f() {\n"
|
||||
" struct X *x = 0;\n"
|
||||
|
|
Loading…
Reference in New Issue