Bug 1524755 - Use ptrdiff_t instead in RangedPtr. r=jwalden, a=RyanVM
authorTooru Fujisawa <arai_a@mac.com>
Fri, 08 Feb 2019 12:13:23 +0900
changeset 512982 2b77d6958f310d832164971626a3686d8826cd40
parent 512981 909f45bf0ed36b79e7f8dc4e8583458341950586
child 512983 81b95ee7a2f3a2e09ac4428bafe6957f5942781a
push id10669
push userryanvm@gmail.com
push dateMon, 11 Feb 2019 12:53:17 +0000
treeherdermozilla-beta@2305c930b771 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden, RyanVM
bugs1524755
milestone66.0
Bug 1524755 - Use ptrdiff_t instead in RangedPtr. r=jwalden, a=RyanVM
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;