Bug 1266614 - Fix C4334 in OrderedHashTable.h. r=jandem
authorXidorn Quan <quanxunzhen@gmail.com>
Fri, 22 Apr 2016 11:19:24 +1000
changeset 332437 cf2cff1fd1942412e36586ab9c42d5baed7cb454
parent 332436 cd38098913193cc5415fe799d6a146d48690a4e4
child 332438 f579f80a80b9a15f7551d36b94ef7264969a3f7d
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem
bugs1266614
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1266614 - Fix C4334 in OrderedHashTable.h. r=jandem MozReview-Commit-ID: 17vReIOrA9k
js/src/ds/OrderedHashTable.h
--- a/js/src/ds/OrderedHashTable.h
+++ b/js/src/ds/OrderedHashTable.h
@@ -630,17 +630,18 @@ class OrderedHashTable
     bool rehash(uint32_t newHashShift) {
         // If the size of the table is not changing, rehash in place to avoid
         // allocating memory.
         if (newHashShift == hashShift) {
             rehashInPlace();
             return true;
         }
 
-        size_t newHashBuckets = 1 << (HashNumberSizeBits - newHashShift);
+        size_t newHashBuckets =
+            size_t(1) << (HashNumberSizeBits - newHashShift);
         Data** newHashTable = alloc.template pod_malloc<Data*>(newHashBuckets);
         if (!newHashTable)
             return false;
         for (uint32_t i = 0; i < newHashBuckets; i++)
             newHashTable[i] = nullptr;
 
         uint32_t newCapacity = uint32_t(newHashBuckets * fillFactor());
         Data* newData = alloc.template pod_malloc<Data>(newCapacity);