mirror of https://github.com/stella-emu/stella.git
Fixed some potential out-of-bounds accesses detected by _GLIBCXX_DEBUG.
This commit is contained in:
parent
ba44910f1e
commit
6815513d47
|
@ -82,7 +82,10 @@ class LinkedObjectPool
|
||||||
iter it = myCurrent;
|
iter it = myCurrent;
|
||||||
uInt32 idx = 1;
|
uInt32 idx = 1;
|
||||||
|
|
||||||
while(it-- != myList.begin()) ++idx;
|
while(it != myList.begin()) {
|
||||||
|
++idx;
|
||||||
|
--it;
|
||||||
|
}
|
||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +230,8 @@ class LinkedObjectPool
|
||||||
active list.
|
active list.
|
||||||
*/
|
*/
|
||||||
void removeToLast() {
|
void removeToLast() {
|
||||||
myPool.splice(myPool.end(), myList, std::next(myCurrent, 1), myList.end());
|
if(currentIsValid())
|
||||||
|
myPool.splice(myPool.end(), myList, std::next(myCurrent, 1), myList.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue