Skip to content

Commit 243ae08

Browse files
Update testuninitvar.cpp
1 parent 6e8b70e commit 243ae08

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/testuninitvar.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2164,6 +2164,13 @@ class TestUninitVar : public TestFixture {
21642164
" return p;\n"
21652165
"}\n");
21662166
ASSERT_EQUALS("[test.cpp:5:9]: (error) Memory is allocated but not initialized: *p [uninitdata]\n", errout_str());
2167+
2168+
checkUninitVar("char* f(size_t nBytes, size_t nAlign) {\n" // #14485
2169+
" char* p = reinterpret_cast<char*>(malloc(nBytes));\n"
2170+
" if ((uintptr_t)p % nAlign != 0) {}\n"
2171+
" return p;\n"
2172+
"}\n");
2173+
ASSERT_EQUALS("", errout_str());
21672174
}
21682175

21692176
// class / struct..

0 commit comments

Comments
 (0)