[llvm-commits] [llvm] r161103 - /llvm/trunk/include/llvm/ADT/TinyPtrVector.h
Chandler Carruth
chandlerc at gmail.com
Wed Aug 1 01:40:46 PDT 2012
Author: chandlerc
Date: Wed Aug 1 03:40:46 2012
New Revision: 161103
URL: http://llvm.org/viewvc/llvm-project?rev=161103&view=rev
Log:
Add basic in-bounds asserts to TinyPtrVector::erase.
Modified:
llvm/trunk/include/llvm/ADT/TinyPtrVector.h
Modified: llvm/trunk/include/llvm/ADT/TinyPtrVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/TinyPtrVector.h?rev=161103&r1=161102&r2=161103&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/TinyPtrVector.h (original)
+++ llvm/trunk/include/llvm/ADT/TinyPtrVector.h Wed Aug 1 03:40:46 2012
@@ -215,6 +215,9 @@
}
iterator erase(iterator I) {
+ assert(I >= begin() && "Iterator to erase is out of bounds.");
+ assert(I < end() && "Erasing at past-the-end iterator.");
+
// If we have a single value, convert to empty.
if (Val.template is<EltTy>()) {
if (I == begin())
More information about the llvm-commits
mailing list