OSDN Git Service

fix a broken assertion in ilist_iterator, which caused it to crash in the
authorChris Lattner <sabre@nondot.org>
Fri, 10 Apr 2009 15:47:17 +0000 (15:47 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 10 Apr 2009 15:47:17 +0000 (15:47 +0000)
bad case instead of actually assert.  Bug pointed out by Jakob Stoklund
Olesen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68785 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ilist.h

index 51442e3..9eb7005 100644 (file)
@@ -210,7 +210,7 @@ public:
   // Increment and decrement operators...
   ilist_iterator &operator--() {      // predecrement - Back up
     NodePtr = Traits::getPrev(NodePtr);
-    assert(Traits::getNext(NodePtr) && "--'d off the beginning of an ilist!");
+    assert(NodePtr && "--'d off the beginning of an ilist!");
     return *this;
   }
   ilist_iterator &operator++() {      // preincrement - Advance