Skip to content
Permalink
Browse files
Use DBUG_ASSERT(ptr != NULL) to ease merging to 10.3
In 10.3, DBUG_ASSERT() may expand to something that includes
__builtin_expect(), which expects integer arguments, not pointers.
To avoid any compiler warnings, let us use an explicit rather than
implicit comparison to the null pointer.
  • Loading branch information
dr-m committed Aug 12, 2020
1 parent 5a4ae14 commit 4387e3a
Showing 1 changed file with 2 additions and 2 deletions.
@@ -71,12 +71,12 @@ template <class T, class Tag= void> class ilist
typedef T *pointer;
typedef T &reference;

Iterator(ListNode *node) : node_(node) { DBUG_ASSERT(node_); }
Iterator(ListNode *node) : node_(node) { DBUG_ASSERT(node_ != NULL); }

Iterator &operator++()
{
node_= node_->next;
DBUG_ASSERT(node_);
DBUG_ASSERT(node_ != NULL);
return *this;
}
Iterator operator++(int)

0 comments on commit 4387e3a

Please sign in to comment.