Add an assertion message to the assert-is-empty in LinkedList::~LinkedList, to indicate to users who hit it that it's the fault of the caller, not the fault of MFBT code. No bug, rs=froydnj
authorJeff Walden <jwalden@mit.edu>
Tue, 16 Feb 2016 13:06:20 -0800
changeset 322647 6d9e6a38bd7caa4e48d9651f8c3dba7433075cc5
parent 322646 15a924a37f91f160e856f4cad28cdebb2659d3de
child 322648 d15669bc8eef4e2e3670604342f2d22f8437c7ae
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
milestone47.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
Add an assertion message to the assert-is-empty in LinkedList::~LinkedList, to indicate to users who hit it that it's the fault of the caller, not the fault of MFBT code. No bug, rs=froydnj
mfbt/LinkedList.h
--- a/mfbt/LinkedList.h
+++ b/mfbt/LinkedList.h
@@ -320,17 +320,22 @@ public:
   };
 
   LinkedList() : sentinel(LinkedListElement<T>::NODE_KIND_SENTINEL) { }
 
   LinkedList(LinkedList<T>&& aOther)
     : sentinel(mozilla::Move(aOther.sentinel))
   { }
 
-  ~LinkedList() { MOZ_ASSERT(isEmpty()); }
+  ~LinkedList() {
+    MOZ_ASSERT(isEmpty(),
+               "failing this assertion means this LinkedList's creator is "
+               "buggy: it should have removed all this list's elements before "
+               "the list's destruction");
+  }
 
   /*
    * Add aElem to the front of the list.
    */
   void insertFront(T* aElem)
   {
     /* Bypass setNext()'s this->isInList() assertion. */
     sentinel.setNextUnsafe(aElem);