Unreviewed, rolling out r187812.
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Aug 2015 17:12:19 +0000 (17:12 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 4 Aug 2015 17:12:19 +0000 (17:12 +0000)
This is not safe

Reverted changeset:

"[WK2] Reserve Vector capacity in VectorArgumentCoder<false,
T, inlineCapacity>::decode()"
https://bugs.webkit.org/show_bug.cgi?id=147619
http://trac.webkit.org/changeset/187812

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

Source/WebKit2/ChangeLog
Source/WebKit2/Platform/IPC/ArgumentCoders.h

index 49f2a6ebaf5fd40681e54484f6e0cb478dd0511f..adc0e7f42aadd864c6be922a8a87400fdfc8cc29 100644 (file)
@@ -1,3 +1,16 @@
+2015-08-04  Chris Dumez  <cdumez@apple.com>
+
+        Unreviewed, rolling out r187812.
+
+        This is not safe
+
+        Reverted changeset:
+
+        "[WK2] Reserve Vector capacity in VectorArgumentCoder<false,
+        T, inlineCapacity>::decode()"
+        https://bugs.webkit.org/show_bug.cgi?id=147619
+        http://trac.webkit.org/changeset/187812
+
 2015-08-03  Chris Dumez  <cdumez@apple.com>
 
         [WK2] Reserve Vector capacity in VectorArgumentCoder<false, T, inlineCapacity>::decode()
index de65ff35c7e857f3e2e97cc5a93c6b5c1cfec97e..983820275756fa32b4aa0dfa4730e20496fce2a6 100644 (file)
@@ -164,15 +164,15 @@ template<typename T, size_t inlineCapacity> struct VectorArgumentCoder<false, T,
             return false;
 
         Vector<T, inlineCapacity> tmp;
-        tmp.reserveInitialCapacity(size);
         for (size_t i = 0; i < size; ++i) {
             T element;
             if (!decoder.decode(element))
                 return false;
             
-            tmp.uncheckedAppend(WTF::move(element));
+            tmp.append(WTF::move(element));
         }
 
+        tmp.shrinkToFit();
         vector.swap(tmp);
         return true;
     }