Bug 1524755 - Use ptrdiff_t instead in RangedPtr. r=jwalden
authorTooru Fujisawa <arai_a@mac.com>
Fri, 08 Feb 2019 12:13:23 +0900
changeset 458209 5732522a3540af8ad2dbfcb156346b6e44ef2233
parent 458208 4c44d5135282e556e37473f06089e085f612f274
child 458210 9849e6b02bc2d32da3403130f1235b7c8296c651
push id35518
push useropoprus@mozilla.com
push dateFri, 08 Feb 2019 09:55:14 +0000
treeherdermozilla-central@3a3e393396f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1524755
milestone67.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 1524755 - Use ptrdiff_t instead in RangedPtr. r=jwalden
mfbt/RangedPtr.h
--- a/mfbt/RangedPtr.h
+++ b/mfbt/RangedPtr.h
@@ -206,17 +206,17 @@ class RangedPtr {
     return *this;
   }
 
   RangedPtr<T>& operator-=(size_t aDec) {
     *this = *this - aDec;
     return *this;
   }
 
-  T& operator[](int aIndex) const {
+  T& operator[](ptrdiff_t aIndex) const {
     MOZ_ASSERT(size_t(aIndex > 0 ? aIndex : -aIndex) <= size_t(-1) / sizeof(T));
     return *create(mPtr + aIndex);
   }
 
   T& operator*() const {
     MOZ_ASSERT(mPtr >= mRangeStart);
     MOZ_ASSERT(mPtr < mRangeEnd);
     return *mPtr;