Title: [118649] trunk/Source/WTF
Revision
118649
Author
da...@apple.com
Date
2012-05-27 22:48:45 -0700 (Sun, 27 May 2012)

Log Message

Fix an incorrect assertion in Vector::remove
https://bugs.webkit.org/show_bug.cgi?id=87612

Reviewed by Dan Bernstein.

* wtf/Vector.h: There's no good reason to disallow calling remove
with a size of 0, even when the position is at the end of the vector,
so changed the two-argument Vector::remove assertion to assert that
the position is <= size rather than < size.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (118648 => 118649)


--- trunk/Source/WTF/ChangeLog	2012-05-28 05:13:48 UTC (rev 118648)
+++ trunk/Source/WTF/ChangeLog	2012-05-28 05:48:45 UTC (rev 118649)
@@ -1,3 +1,15 @@
+2012-05-27  Darin Adler  <da...@apple.com>
+
+        Fix an incorrect assertion in Vector::remove
+        https://bugs.webkit.org/show_bug.cgi?id=87612
+
+        Reviewed by Dan Bernstein.
+
+        * wtf/Vector.h: There's no good reason to disallow calling remove
+        with a size of 0, even when the position is at the end of the vector,
+        so changed the two-argument Vector::remove assertion to assert that
+        the position is <= size rather than < size.
+
 2012-05-27  Yoshifumi Inoue  <yo...@chromium.org>
 
         [WTF] Introduce UINT64_C to MathExtras.h

Modified: trunk/Source/WTF/wtf/Vector.h (118648 => 118649)


--- trunk/Source/WTF/wtf/Vector.h	2012-05-28 05:13:48 UTC (rev 118648)
+++ trunk/Source/WTF/wtf/Vector.h	2012-05-28 05:48:45 UTC (rev 118649)
@@ -1110,7 +1110,7 @@
     template<typename T, size_t inlineCapacity>
     inline void Vector<T, inlineCapacity>::remove(size_t position, size_t length)
     {
-        ASSERT(position < size());
+        ASSERT(position <= size());
         ASSERT(position + length <= size());
         T* beginSpot = begin() + position;
         T* endSpot = beginSpot + length;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to