Skip to content

Commit bb3c060

Browse files
authored
[libc++] Fix incorrect down-cast in __tree (#152181)
1 parent 4882874 commit bb3c060

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcxx/include/__tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,8 +1445,8 @@ __tree<_Tp, _Compare, _Allocator>::__tree(const __tree& __t)
14451445

14461446
*__root_ptr() = static_cast<__node_base_pointer>(__copy_construct_tree(__t.__root()));
14471447
__root()->__parent_ = __end_node();
1448-
__begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(static_cast<__node_base_pointer>(__end_node())));
1449-
__size_ = __t.size();
1448+
__begin_node_ = static_cast<__end_node_pointer>(std::__tree_min(__end_node()->__left_));
1449+
__size_ = __t.size();
14501450
}
14511451

14521452
template <class _Tp, class _Compare, class _Allocator>

0 commit comments

Comments
 (0)