Regression for issue 8653: valueFlowAfterCondition: compound conditional (#2416)
This commit is contained in:
parent
9cb39b1d7e
commit
78b4485670
|
@ -127,6 +127,7 @@ private:
|
|||
TEST_CASE(array_index_46); // #4840 - two-statement for loop
|
||||
TEST_CASE(array_index_47); // #5849
|
||||
TEST_CASE(array_index_48); // #9478
|
||||
TEST_CASE(array_index_49); // #8653
|
||||
TEST_CASE(array_index_multidim);
|
||||
TEST_CASE(array_index_switch_in_for);
|
||||
TEST_CASE(array_index_for_in_for); // FP: #2634
|
||||
|
@ -1494,6 +1495,20 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void array_index_49() {
|
||||
// #8653
|
||||
check("void f() {\n"
|
||||
" int i, k;\n"
|
||||
" int arr[34] = {};\n"
|
||||
" i = 1;\n"
|
||||
" for (k = 0; k < 34 && i < 34; k++) {\n"
|
||||
" i++;\n"
|
||||
" }\n"
|
||||
" arr[k];\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void array_index_multidim() {
|
||||
check("void f()\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue