summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2020-08-11 20:12:30 +0300
committerEugene Kosov <claprix@yandex.ru>2020-08-11 20:13:09 +0300
commit01738d08f30315f10c14faa605d0087e54156cd0 (patch)
tree121dbf3e37f2762182fa7d345affaa4ca690d8c1 /include
parentc96be848d3bbb668d27645c36ca66c697fdc2752 (diff)
downloadmariadb-git-01738d08f30315f10c14faa605d0087e54156cd0.tar.gz
add debug assertion to ilist
Diffstat (limited to 'include')
-rw-r--r--include/ilist.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/ilist.h b/include/ilist.h
index 722677f9057..4b89efe7717 100644
--- a/include/ilist.h
+++ b/include/ilist.h
@@ -26,8 +26,7 @@ template <class Tag= void> struct ilist_node
{
ilist_node()
#ifndef DBUG_OFF
- :
- next(NULL), prev(NULL)
+ : next(NULL), prev(NULL)
#endif
{
}
@@ -70,11 +69,12 @@ public:
typedef T *pointer;
typedef T &reference;
- Iterator(ListNode *node) : node_(node) {}
+ Iterator(ListNode *node) : node_(node) { assert(node_); }
Iterator &operator++()
{
node_= node_->next;
+ assert(node_);
return *this;
}
Iterator operator++(int)
@@ -87,6 +87,7 @@ public:
Iterator &operator--()
{
node_= node_->prev;
+ assert(node_);
return *this;
}
Iterator operator--(int)