[libcxx] r260526 - Properly down-cast a sentinal node pointer through void*
Eric Fiselier via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 11 07:22:38 PST 2016
Author: ericwf
Date: Thu Feb 11 09:22:37 2016
New Revision: 260526
URL: http://llvm.org/viewvc/llvm-project?rev=260526&view=rev
Log:
Properly down-cast a sentinal node pointer through void*
Modified:
libcxx/trunk/include/__hash_table
Modified: libcxx/trunk/include/__hash_table
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__hash_table?rev=260526&r1=260525&r2=260526&view=diff
==============================================================================
--- libcxx/trunk/include/__hash_table (original)
+++ libcxx/trunk/include/__hash_table Thu Feb 11 09:22:37 2016
@@ -917,6 +917,7 @@ public:
typedef typename _NodeTypes::__node_type __node;
typedef typename __rebind_alloc_helper<__alloc_traits, __node>::type __node_allocator;
typedef allocator_traits<__node_allocator> __node_traits;
+ typedef typename _NodeTypes::__void_pointer __void_pointer;
typedef typename _NodeTypes::__node_pointer __node_pointer;
typedef typename _NodeTypes::__node_pointer __node_const_pointer;
typedef typename _NodeTypes::__node_base_type __first_node;
@@ -1955,7 +1956,7 @@ __hash_table<_Tp, _Hash, _Equal, _Alloc>
__node_pointer __pn = __bucket_list_[__chash];
if (__pn == nullptr)
{
- __pn = static_cast<__node_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first()));
+ __pn = static_cast<__node_pointer>(static_cast<__void_pointer>(pointer_traits<__node_base_pointer>::pointer_to(__p1_.first())));
__h->__next_ = __pn->__next_;
__pn->__next_ = __h.get();
// fix up __bucket_list_
More information about the cfe-commits
mailing list