Skip to content

Commit 5494264

Browse files
_ptr is not initialized
1 parent 5823758 commit 5494264

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

libcxx/include/__tree

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _EndNodePtr __tree_ne
208208
_LIBCPP_ASSERT_INTERNAL(__x != nullptr, "node shouldn't be null");
209209
if (__x->__right_ != nullptr)
210210
return std::__static_fancy_pointer_cast<_EndNodePtr>(std::__tree_min(__x->__right_));
211-
auto __dddd = __x->__parent_;
212-
auto ___xxx = __dddd->__left_;
213-
(void)___xxx;
214211
while (!std::__tree_is_left_child(__x))
215212
__x = __x->__parent_unsafe();
216213
return static_cast<_EndNodePtr>(__x->__parent_);
@@ -565,7 +562,7 @@ public:
565562
typedef _Pointer pointer;
566563
pointer __left_;
567564

568-
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_end_node() _NOEXCEPT : __left_() {}
565+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 __tree_end_node() _NOEXCEPT : __left_(nullptr) {}
569566
};
570567

571568
template <class _VoidPtr>
@@ -1016,12 +1013,10 @@ public:
10161013

10171014
template <class... _Args>
10181015
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 pair<iterator, bool> __emplace_hint_unique(const_iterator __p, _Args&&... __args) {
1019-
(void)__p.__ptr_->__left_;
10201016
return std::__try_key_extraction<key_type>(
10211017
[this, __p](const key_type& __key, _Args&&... __args2) {
10221018
__end_node_pointer __parent;
10231019
__node_base_pointer __dummy;
1024-
(void)__p.__ptr_->__left_;
10251020
__node_base_pointer& __child = __find_equal(__p, __parent, __dummy, __key);
10261021
__node_pointer __r = std::__static_fancy_pointer_cast<__node_pointer>(__child);
10271022
bool __inserted = false;
@@ -1456,20 +1451,20 @@ private:
14561451
template <class _Tp, class _Compare, class _Allocator>
14571452
_LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp) _NOEXCEPT_(
14581453
is_nothrow_default_constructible<__node_allocator>::value&& is_nothrow_copy_constructible<value_compare>::value)
1459-
: __size_(0), __value_comp_(__comp) {
1454+
: __end_node_(), __size_(0), __value_comp_(__comp) {
14601455
__begin_node_ = __end_node();
14611456
}
14621457

14631458
template <class _Tp, class _Compare, class _Allocator>
14641459
_LIBCPP_CONSTEXPR_SINCE_CXX26 __tree<_Tp, _Compare, _Allocator>::__tree(const allocator_type& __a)
1465-
: __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0) {
1460+
: __begin_node_(), __end_node_(), __node_alloc_(__node_allocator(__a)), __size_(0) {
14661461
__begin_node_ = __end_node();
14671462
}
14681463

14691464
template <class _Tp, class _Compare, class _Allocator>
14701465
_LIBCPP_CONSTEXPR_SINCE_CXX26
14711466
__tree<_Tp, _Compare, _Allocator>::__tree(const value_compare& __comp, const allocator_type& __a)
1472-
: __begin_node_(), __node_alloc_(__node_allocator(__a)), __size_(0), __value_comp_(__comp) {
1467+
: __begin_node_(), __end_node_(), __node_alloc_(__node_allocator(__a)), __size_(0), __value_comp_(__comp) {
14731468
__begin_node_ = __end_node();
14741469
}
14751470

@@ -1875,9 +1870,6 @@ __tree<_Tp, _Compare, _Allocator>::__find_equal(
18751870
const_iterator __prior = __hint;
18761871
if (__prior == begin() || value_comp()(*--__prior, __v)) {
18771872
// *prev(__hint) < __v < *__hint
1878-
auto __xx = __hint.__ptr_;
1879-
auto __yy = __xx->__left_;
1880-
(void)( __yy);
18811873
if (__hint.__ptr_->__left_ == nullptr) {
18821874
__parent = __hint.__ptr_;
18831875
return __parent->__left_;

0 commit comments

Comments
 (0)