Skip to content

Commit fa6a550

Browse files
committed
test
1 parent 777a112 commit fa6a550

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/testvalueflow.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7939,6 +7939,17 @@ class TestValueFlow : public TestFixture {
79397939
" (void) x;\n"
79407940
"}\n";
79417941
ASSERT_EQUALS(true, testValueOfX(code, 4U, 0, ValueFlow::Value::ValueType::BUFFER_SIZE));
7942+
7943+
code = "void f(int *x)\n"
7944+
"{\n"
7945+
" *x = 1;\n"
7946+
"}\n"
7947+
"void g(void)\n"
7948+
"{\n"
7949+
" int *ptr = malloc(1234);\n"
7950+
" f(ptr);\n"
7951+
"}\n";
7952+
ASSERT_EQUALS(true, testValueOfX(code, 3U, 1234, ValueFlow::Value::ValueType::BUFFER_SIZE));
79427953
}
79437954

79447955
void valueFlowSafeFunctionParameterValues() {

0 commit comments

Comments
 (0)