#7682 Added regression test
This commit is contained in:
parent
6fd916a90f
commit
185a5e1ee6
|
@ -132,6 +132,7 @@ private:
|
|||
TEST_CASE(array_index_49); // #8653
|
||||
TEST_CASE(array_index_50);
|
||||
TEST_CASE(array_index_51); // #3763
|
||||
TEST_CASE(array_index_52); // #7682
|
||||
TEST_CASE(array_index_multidim);
|
||||
TEST_CASE(array_index_switch_in_for);
|
||||
TEST_CASE(array_index_for_in_for); // FP: #2634
|
||||
|
@ -1534,6 +1535,17 @@ private:
|
|||
ASSERT_EQUALS("[test.cpp:3]: (error) Array 'd[1]' accessed at index 1, which is out of bounds.\n", errout.str());
|
||||
}
|
||||
|
||||
void array_index_52() {
|
||||
check("char f(void)\n"
|
||||
"{\n"
|
||||
" char buf[10];\n"
|
||||
" for(int i = 0, j= 11; i < j; ++i)\n"
|
||||
" buf[i] = 0;\n"
|
||||
" return buf[0];\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("[test.cpp:5]: (error) Array 'buf[10]' accessed at index 10, which is out of bounds.\n", errout.str());
|
||||
}
|
||||
|
||||
void array_index_multidim() {
|
||||
check("void f()\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue