diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2014-04-11 08:22:42 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2014-04-11 08:22:42 +0000 |
commit | ec959d5f46b6d54be51000cf1eb7707b9b9488a5 (patch) | |
tree | 549a9db74655c63221da15998dcd08d5b1070d01 | |
parent | dca4162aa52eacf921e17ce52eb68365bbb37db2 (diff) | |
download | bcm5719-llvm-ec959d5f46b6d54be51000cf1eb7707b9b9488a5.tar.gz bcm5719-llvm-ec959d5f46b6d54be51000cf1eb7707b9b9488a5.zip |
Remove node from a container before destroying it. Thanks to Alexander Potapenko for pointing this out.
llvm-svn: 206024
-rw-r--r-- | libcxx/include/__tree | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/include/__tree b/libcxx/include/__tree index acf87593a97..8e5447a2ffb 100644 --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -1980,9 +1980,9 @@ __tree<_Tp, _Compare, _Allocator>::erase(const_iterator __p) __begin_node() = __r.__ptr_; --size(); __node_allocator& __na = __node_alloc(); - __node_traits::destroy(__na, const_cast<value_type*>(_VSTD::addressof(*__p))); __tree_remove(__end_node()->__left_, static_cast<__node_base_pointer>(__np)); + __node_traits::destroy(__na, const_cast<value_type*>(_VSTD::addressof(*__p))); __node_traits::deallocate(__na, __np, 1); return __r; } |