[libcxx-commits] [libcxx] bb3c060 - [libc++] Fix incorrect down-cast in __tree (#152181)
via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Aug 5 10:55:33 PDT 2025
Author: Nikolas Klauser
Date: 2025-08-05T19:55:30+02:00
New Revision: bb3c060ca41455bc48e48ec51a66910c164b4345
URL: https://github.com/llvm/llvm-project/commit/bb3c060ca41455bc48e48ec51a66910c164b4345
DIFF: https://github.com/llvm/llvm-project/commit/bb3c060ca41455bc48e48ec51a66910c164b4345.diff
LOG: [libc++] Fix incorrect down-cast in __tree (#152181)
Added:
Modified:
libcxx/include/__tree
Removed:
################################################################################
diff --git a/libcxx/include/__tree b/libcxx/include/__tree
index 1b1bb538029da..6ca1a623536f2 100644
--- a/libcxx/include/__tree
+++ b/libcxx/include/__tree
@@ -1445,8 +1445,8 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
*__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
__root()->__parent_ = __end_node();
- __begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(static_cast<__node_base_pointer>(__end_node())));
- __size_ = __t.size();
+ __begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
+ __size_ = __t.size();
}
template <class _Tp, class _Compare, class _Allocator>
More information about the libcxx-commits
mailing list