* Add test for #10643

* Comment

* Fox comment
This commit is contained in:
chrchr-github 2022-06-24 13:55:04 +02:00 committed by GitHub
parent 60c1eef659
commit 11860cce4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 0 deletions

View File

@ -6189,6 +6189,15 @@ private:
"[test.cpp:8] -> [test.cpp:3]: (error) Uninitialized variable: abc->c\n",
"[test.cpp:8] -> [test.cpp:3]: (error) Uninitialized variable: abc->b\n",
errout.str());
valueFlowUninit("struct S { int* p; };\n" // #10463
"void f(S* in) {\n"
" S* s;\n"
" memcpy(in, s, sizeof(S));\n"
" s->p = NULL;\n"
"}\n");
ASSERT_EQUALS("[test.cpp:4]: (error) Uninitialized variable: s\n",
errout.str());
}
void uninitvar_memberfunction() {