diff --git a/xpcom/ds/PLDHashTable.cpp b/xpcom/ds/PLDHashTable.cpp index 655f418b0cf2..a5254b10c874 100644 --- a/xpcom/ds/PLDHashTable.cpp +++ b/xpcom/ds/PLDHashTable.cpp @@ -728,6 +728,7 @@ PLDHashTable::Iterator::Iterator(Iterator&& aOther) , mNexts(aOther.mNexts) , mNextsLimit(aOther.mNextsLimit) , mHaveRemoved(aOther.mHaveRemoved) + , mEntrySize(aOther.mEntrySize) { // No need to change |mChecker| here. aOther.mTable = nullptr; @@ -736,6 +737,7 @@ PLDHashTable::Iterator::Iterator(Iterator&& aOther) aOther.mNexts = 0; aOther.mNextsLimit = 0; aOther.mHaveRemoved = false; + aOther.mEntrySize = 0; } PLDHashTable::Iterator::Iterator(PLDHashTable* aTable) @@ -745,6 +747,7 @@ PLDHashTable::Iterator::Iterator(PLDHashTable* aTable) , mNexts(0) , mNextsLimit(mTable->EntryCount()) , mHaveRemoved(false) + , mEntrySize(aTable->mEntrySize) { #ifdef DEBUG mTable->mChecker.StartReadOp(); @@ -788,7 +791,7 @@ PLDHashTable::Iterator::IsOnNonLiveEntry() const MOZ_ALWAYS_INLINE void PLDHashTable::Iterator::MoveToNextEntry() { - mCurrent += mTable->mEntrySize; + mCurrent += mEntrySize; if (mCurrent == mLimit) { mCurrent = mTable->mEntryStore.Get(); // Wrap-around. Possible due to Chaos Mode. } diff --git a/xpcom/ds/PLDHashTable.h b/xpcom/ds/PLDHashTable.h index b19dc5603a25..cd73f1b1df50 100644 --- a/xpcom/ds/PLDHashTable.h +++ b/xpcom/ds/PLDHashTable.h @@ -491,6 +491,7 @@ public: uint32_t mNextsLimit; // Next() call limit. bool mHaveRemoved; // Have any elements been removed? + uint8_t mEntrySize; // Size of entries. bool IsOnNonLiveEntry() const; void MoveToNextEntry();