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.
This commit is contained in:
Vadim Zeitlin 2022-08-04 00:22:41 +02:00
parent 6efb8e810b
commit f27acce6cd

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);