summaryrefslogtreecommitdiff
path: root/libcxx/include/__node_handle
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2023-10-12 20:13:08 -0700
committerLouis Dionne <ldionne.2@gmail.com>2023-10-13 08:03:22 -0700
commitba79fb2e1ff7130cde02fbbd325f0f96f8a522ca (patch)
tree94e3af3bd70dc6f155385aa3740a556fa7e63333 /libcxx/include/__node_handle
parentb22917e6e2a0aec05474f58e64b7e87d1ea0a054 (diff)
[libc++] Re-apply "Remove UB in list, forward_list and __hash_table"
This patch removes undefined behavior in list and forward_list and __hash_table caused by improperly beginning and ending the lifetime of the various node classes. It allows removing the _LIBCPP_STANDALONE_DEBUG macro from these node types since we now properly begin and end their lifetime, meaning that we won't trip up constructor homing. See https://reviews.llvm.org/D98750 for more information on what prompted this patch. This commit re-applies 0687e4d9f310, which had been reverted in b935882bdce7 because it broke the LLDB build. LLDB folks tell me I can go ahead and re-commit this now. Differential Revision: https://reviews.llvm.org/D101206 Co-authored-by: Amy Kwan <amy.kwan1@ibm.com>
Diffstat (limited to 'libcxx/include/__node_handle')
-rw-r--r--libcxx/include/__node_handle6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/include/__node_handle b/libcxx/include/__node_handle
index cc4eaf73c0bb..b3cc3619dd5a 100644
--- a/libcxx/include/__node_handle
+++ b/libcxx/include/__node_handle
@@ -209,7 +209,7 @@ struct __set_node_handle_specifics
_LIBCPP_INLINE_VISIBILITY
value_type& value() const
{
- return static_cast<_Derived const*>(this)->__ptr_->__value_;
+ return static_cast<_Derived const*>(this)->__ptr_->__get_value();
}
};
@@ -223,14 +223,14 @@ struct __map_node_handle_specifics
key_type& key() const
{
return static_cast<_Derived const*>(this)->
- __ptr_->__value_.__ref().first;
+ __ptr_->__get_value().__ref().first;
}
_LIBCPP_INLINE_VISIBILITY
mapped_type& mapped() const
{
return static_cast<_Derived const*>(this)->
- __ptr_->__value_.__ref().second;
+ __ptr_->__get_value().__ref().second;
}
};