OSDN Git Service

Ensure that Vector::erase() returns a valid iterator
authorJason Simmons <jsimmons@google.com>
Thu, 25 Oct 2012 22:58:43 +0000 (15:58 -0700)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Thu, 1 Nov 2012 23:33:50 +0000 (16:33 -0700)
Vector::erase may reallocate the Vector's storage while removing an element.
However, erase() calls begin() before calling removeItemsAt(), thus caching
a pointer the the Vector's old storage.  If the storage is reallocated,
the iterator returned by erase() will be based on the old storage pointer
and will thus be invalid.

Bug: 7433283

Change-Id: I91980e0fcb5a2e0a55f1a78444a5958037afdbed


No differences found