Skip to content

Commit 17cb445

Browse files
Add test for #11152
1 parent 46018f1 commit 17cb445

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

test/testvalueflow.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6290,6 +6290,14 @@ class TestValueFlow : public TestFixture {
62906290
"}\n";
62916291
values = tokenValues(code, "x > 5", ValueFlow::Value::ValueType::UNINIT);
62926292
ASSERT_EQUALS(0, values.size());
6293+
6294+
code = "void f() {\n" // #11152
6295+
" char b[10];\n"
6296+
" sprintf(b, \"abc\");\n"
6297+
" printf(\"%s\", b);\n"
6298+
"}\n";
6299+
values = tokenValues(code, "b )", ValueFlow::Value::ValueType::UNINIT);
6300+
ASSERT_EQUALS(0, values.size());
62936301
}
62946302

62956303
void valueFlowConditionExpressions() {

0 commit comments

Comments
 (0)