@@ -1047,7 +1047,8 @@ class TestBufferOverrun : public TestFixture {
10471047 " for (int i = 3; 0 <= i; i--)\n "
10481048 " a[i] = i;\n "
10491049 " }" );
1050- ASSERT_EQUALS (" [test.cpp:5]: (error) Buffer is accessed out of bounds: a\n " , errout.str ());
1050+ ASSERT_EQUALS (" [test.cpp:5]: (error) Buffer is accessed out of bounds: a\n "
1051+ " [test.cpp:5]: (error) Array 'a[3]' accessed at index 3, which is out of bounds.\n " , errout.str ());
10511052
10521053 check (" void f()\n "
10531054 " {\n "
@@ -1536,7 +1537,8 @@ class TestBufferOverrun : public TestFixture {
15361537 " buffer[i] = i;\n "
15371538 " }\n "
15381539 " }" );
1539- ASSERT_EQUALS (" [test.cpp:5]: (error) Buffer is accessed out of bounds: buffer\n " , errout.str ());
1540+ ASSERT_EQUALS (" [test.cpp:5]: (error) Buffer is accessed out of bounds: buffer\n "
1541+ " [test.cpp:5]: (error) Array 'buffer[9]' accessed at index 9, which is out of bounds.\n " , errout.str ());
15401542
15411543 // Correct access limits -> i from 9 to 0
15421544 check (" void f() {\n "
@@ -1768,7 +1770,8 @@ class TestBufferOverrun : public TestFixture {
17681770 " data[i] = 0;\n "
17691771 " }\n "
17701772 " }" );
1771- ASSERT_EQUALS (" [test.cpp:5]: (error) Buffer is accessed out of bounds: data\n " , errout.str ());
1773+ ASSERT_EQUALS (" [test.cpp:5]: (error) Buffer is accessed out of bounds: data\n "
1774+ " [test.cpp:5]: (error) Array 'data[8]' accessed at index 10, which is out of bounds.\n " , errout.str ());
17721775
17731776 check (" void f()\n "
17741777 " {\n "
@@ -1902,7 +1905,8 @@ class TestBufferOverrun : public TestFixture {
19021905 " a[i] = 0;\n "
19031906 " }\n "
19041907 " }" );
1905- ASSERT_EQUALS (" [test.cpp:4]: (error) Buffer is accessed out of bounds: a\n " , errout.str ());
1908+ ASSERT_EQUALS (" [test.cpp:4]: (error) Buffer is accessed out of bounds: a\n "
1909+ " [test.cpp:4]: (error) Array 'a[10]' accessed at index 10, which is out of bounds.\n " , errout.str ());
19061910 }
19071911
19081912 void array_index_for_neq () {
0 commit comments