Title: [256686] branches/safari-609-branch/Source/WTF
Revision
256686
Author
repst...@apple.com
Date
2020-02-14 19:02:19 -0800 (Fri, 14 Feb 2020)

Log Message

Cherry-pick r256203. rdar://problem/59446995

    Unreviewed, speculative build fix on watchOS simulator
    https://bugs.webkit.org/show_bug.cgi?id=207183

    * wtf/HashTable.h:
    (WTF::HashTableCapacityForSize::capacityForSize):

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

Modified Paths

Diff

Modified: branches/safari-609-branch/Source/WTF/ChangeLog (256685 => 256686)


--- branches/safari-609-branch/Source/WTF/ChangeLog	2020-02-15 03:02:16 UTC (rev 256685)
+++ branches/safari-609-branch/Source/WTF/ChangeLog	2020-02-15 03:02:19 UTC (rev 256686)
@@ -1,5 +1,25 @@
 2020-02-14  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r256203. rdar://problem/59446995
+
+    Unreviewed, speculative build fix on watchOS simulator
+    https://bugs.webkit.org/show_bug.cgi?id=207183
+    
+    * wtf/HashTable.h:
+    (WTF::HashTableCapacityForSize::capacityForSize):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@256203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-02-10  Yusuke Suzuki  <ysuz...@apple.com>
+
+            Unreviewed, speculative build fix on watchOS simulator
+            https://bugs.webkit.org/show_bug.cgi?id=207183
+
+            * wtf/HashTable.h:
+            (WTF::HashTableCapacityForSize::capacityForSize):
+
+2020-02-14  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r256194. rdar://problem/59446995
 
     Unreviewed, fix build failure on watchOS simulator

Modified: branches/safari-609-branch/Source/WTF/wtf/HashTable.h (256685 => 256686)


--- branches/safari-609-branch/Source/WTF/wtf/HashTable.h	2020-02-15 03:02:16 UTC (rev 256685)
+++ branches/safari-609-branch/Source/WTF/wtf/HashTable.h	2020-02-15 03:02:19 UTC (rev 256686)
@@ -327,9 +327,15 @@
         {
             if (!sizeArg)
                 return 0;
-            uint64_t capacity = roundUpToPowerOfTwo(sizeArg);
-            if (shouldExpand(sizeArg, capacity))
+            constexpr unsigned maxCapacity = 1U << 31;
+            UNUSED_PARAM(maxCapacity);
+            ASSERT_UNDER_CONSTEXPR_CONTEXT(sizeArg <= maxCapacity);
+            uint32_t capacity = roundUpToPowerOfTwo(sizeArg);
+            ASSERT_UNDER_CONSTEXPR_CONTEXT(capacity <= maxCapacity);
+            if (shouldExpand(sizeArg, capacity)) {
+                ASSERT_UNDER_CONSTEXPR_CONTEXT((static_cast<uint64_t>(capacity) * 2) <= maxCapacity);
                 return capacity * 2;
+            }
             return capacity;
         }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to