Prohibit shrinking the FastBitVector
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 May 2018 17:54:01 +0000 (17:54 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 May 2018 17:54:01 +0000 (17:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181020

Reviewed by Oliver Hunt.

Prohibit shrinking the FastBitVector. It's not prepared for this and the current usage does
not require it.

* wtf/FastBitVector.cpp:
(WTF::FastBitVectorWordOwner::resizeSlow):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232119 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/FastBitVector.cpp

index 1c667d0..f5f6b99 100644 (file)
@@ -1,3 +1,16 @@
+2018-05-22  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Prohibit shrinking the FastBitVector
+        https://bugs.webkit.org/show_bug.cgi?id=181020
+
+        Reviewed by Oliver Hunt.
+
+        Prohibit shrinking the FastBitVector. It's not prepared for this and the current usage does
+        not require it.
+
+        * wtf/FastBitVector.cpp:
+        (WTF::FastBitVectorWordOwner::resizeSlow):
+
 2018-05-22  Mark Lam  <mark.lam@apple.com>
 
         StringImpl utf8 conversion should not fail silently.
index eed3169..8b019aa 100644 (file)
@@ -42,6 +42,8 @@ void FastBitVectorWordOwner::setEqualsSlow(const FastBitVectorWordOwner& other)
 void FastBitVectorWordOwner::resizeSlow(size_t numBits)
 {
     size_t newLength = fastBitVectorArrayLength(numBits);
+
+    RELEASE_ASSERT(newLength >= arrayLength());
     
     // Use fastCalloc instead of fastRealloc because we expect the common
     // use case for this method to be initializing the size of the bitvector.