Changeset 248044 in webkit


Ignore:
Timestamp:
Jul 31, 2019 9:26:57 AM (5 years ago)
Author:
Keith Rollin
Message:

Fix 64-bit vs 32-bit mismatch in PersistentCoders.h
https://bugs.webkit.org/show_bug.cgi?id=200288
<rdar://problem/53734203>

Reviewed by Chris Dumez.

hashMapSize is declared as a uint64_t. It is passed to
HashMapType::reserveInitialCapacity, which takes an unsigned int. This
is a 32-bit value on 32-bit platforms, leading to a compile time
error. Fix his by casting hashMapSize to the expected type.

  • wtf/persistence/PersistentCoders.h:
Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r248043 r248044  
     12019-07-31  Keith Rollin  <krollin@apple.com>
     2
     3        Fix 64-bit vs 32-bit mismatch in PersistentCoders.h
     4        https://bugs.webkit.org/show_bug.cgi?id=200288
     5        <rdar://problem/53734203>
     6
     7        Reviewed by Chris Dumez.
     8
     9        hashMapSize is declared as a uint64_t. It is passed to
     10        HashMapType::reserveInitialCapacity, which takes an unsigned int. This
     11        is a 32-bit value on 32-bit platforms, leading to a compile time
     12        error. Fix his by casting hashMapSize to the expected type.
     13
     14        * wtf/persistence/PersistentCoders.h:
     15
    1162019-07-31  Keith Rollin  <krollin@apple.com>
    217
  • trunk/Source/WTF/wtf/persistence/PersistentCoders.h

    r247673 r248044  
    197197
    198198        HashMapType tempHashMap;
    199         tempHashMap.reserveInitialCapacity(hashMapSize);
     199        tempHashMap.reserveInitialCapacity(static_cast<unsigned>(hashMapSize));
    200200        for (uint64_t i = 0; i < hashMapSize; ++i) {
    201201            KeyArg key;
Note: See TracChangeset for help on using the changeset viewer.