[libcxx-commits] [libcxx] 5e7367d - Add a missing debug assertion in <list>.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 18 16:40:42 PDT 2021


Author: Arthur O'Dwyer
Date: 2021-04-18T19:40:17-04:00
New Revision: 5e7367d3e44424c058cc8d891dac0a0088586329

URL: https://github.com/llvm/llvm-project/commit/5e7367d3e44424c058cc8d891dac0a0088586329
DIFF: https://github.com/llvm/llvm-project/commit/5e7367d3e44424c058cc8d891dac0a0088586329.diff

LOG: Add a missing debug assertion in <list>.

This came up in D100595.

Differential Revision: https://reviews.llvm.org/D100728

Added: 
    

Modified: 
    libcxx/include/list

Removed: 
    


################################################################################
diff  --git a/libcxx/include/list b/libcxx/include/list
index cfb28e86f9f2..7d616faa64ff 100644
--- a/libcxx/include/list
+++ b/libcxx/include/list
@@ -2099,6 +2099,9 @@ list<_Tp, _Alloc>::splice(const_iterator __p, list& __c, const_iterator __f, con
     _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__f) == &__c,
         "list::splice(iterator, list, iterator, iterator) called with second iterator not"
         " referring to list argument");
+    _LIBCPP_ASSERT(__get_const_db()->__find_c_from_i(&__l) == &__c,
+        "list::splice(iterator, list, iterator, iterator) called with third iterator not"
+        " referring to list argument");
     if (this == &__c)
     {
         for (const_iterator __i = __f; __i != __l; ++__i)


        


More information about the libcxx-commits mailing list