Bug 906909 - Make LinkedList::debugAssertIsSane() compile. r=waldo
authorJustin Lebar <justin.lebar@gmail.com>
Wed, 21 Aug 2013 12:04:29 -0700
changeset 157627 35c8fa3d4fe734f9d55985e2540726b25fd6c275
parent 157626 9cc9b4f6367886d53f17ff05eb85a41a0d5c249c
child 157628 b1beca39585a1f14b08ed2b9e846f604180ee824
push id407
push userlsblakk@mozilla.com
push dateTue, 03 Dec 2013 03:32:50 +0000
treeherdermozilla-release@babf8c9ebc52 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswaldo
bugs906909
milestone26.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 906909 - Make LinkedList::debugAssertIsSane() compile. r=waldo
mfbt/LinkedList.h
--- a/mfbt/LinkedList.h
+++ b/mfbt/LinkedList.h
@@ -356,55 +356,55 @@ class LinkedList
 
       /*
        * Check for cycles in the forward singly-linked list using the
        * tortoise/hare algorithm.
        */
       for (slow = sentinel.next,
            fast1 = sentinel.next->next,
            fast2 = sentinel.next->next->next;
-           slow != sentinel && fast1 != sentinel && fast2 != sentinel;
+           slow != &sentinel && fast1 != &sentinel && fast2 != &sentinel;
            slow = slow->next, fast1 = fast2->next, fast2 = fast1->next)
       {
         MOZ_ASSERT(slow != fast1);
         MOZ_ASSERT(slow != fast2);
       }
 
       /* Check for cycles in the backward singly-linked list. */
       for (slow = sentinel.prev,
            fast1 = sentinel.prev->prev,
            fast2 = sentinel.prev->prev->prev;
-           slow != sentinel && fast1 != sentinel && fast2 != sentinel;
+           slow != &sentinel && fast1 != &sentinel && fast2 != &sentinel;
            slow = slow->prev, fast1 = fast2->prev, fast2 = fast1->prev)
       {
         MOZ_ASSERT(slow != fast1);
         MOZ_ASSERT(slow != fast2);
       }
 
       /*
        * Check that |sentinel| is the only node in the list with
        * isSentinel == true.
        */
       for (const LinkedListElement<T>* elem = sentinel.next;
-           elem != sentinel;
+           elem != &sentinel;
            elem = elem->next)
       {
         MOZ_ASSERT(!elem->isSentinel);
       }
 
       /* Check that the next/prev pointers match up. */
-      const LinkedListElement<T>* prev = sentinel;
+      const LinkedListElement<T>* prev = &sentinel;
       const LinkedListElement<T>* cur = sentinel.next;
       do {
           MOZ_ASSERT(cur->prev == prev);
           MOZ_ASSERT(prev->next == cur);
 
           prev = cur;
           cur = cur->next;
-      } while (cur != sentinel);
+      } while (cur != &sentinel);
 #endif /* ifdef DEBUG */
     }
 
   private:
     friend class LinkedListElement<T>;
 
     void assertContains(const T* t) const {
 #ifdef DEBUG