Avoid using invalid addresses in ListsTestCase too

This is similar to the previous commit, but done in a slightly different
way to avoid changing too much of the existing code: just make "i" an
alias for the first array element to ensure that "&i + 4" is a valid
pointer.

(cherry picked from commit f27acce6cd1164fcb0ec869cd8e7df57419c44e0)
This commit is contained in:
Vadim Zeitlin 2022-08-04 00:22:41 +02:00
parent 413385cf21
commit ee8b3ecb8f

View File

@ -114,7 +114,8 @@ void ListsTestCase::wxStdListTest()
wxListInt list1;
wxListInt::iterator it, en;
wxListInt::reverse_iterator rit, ren;
int i;
int buf[4];
int& i = buf[0];
for ( i = 0; i < 5; ++i )
list1.push_back(i + &i);