commit | 61db1669f491b221411269f62bd1cb458a543181 | [log] [tgz] |
---|---|---|
author | Jason Simmons <jsimmons@google.com> | Thu Oct 25 15:58:43 2012 -0700 |
committer | Alex Ray <aray@google.com> | Tue Jul 30 13:57:00 2013 -0700 |
tree | d04438b0374f640873f35b4000595db6dd04e667 | |
parent | d49555291a356fae02430a5f8fa33b37306bec42 [diff] |
Ensure that Vector::erase() returns a valid iterator 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. Change-Id: I2450c55fd418e6b1c558a4ca7c024573abbaa098