aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Pluzhnikov <ppluzhnikov@google.com>2013-01-22 14:58:23 +0000
committerPaul Pluzhnikov <ppluzhnikov@google.com>2013-01-22 14:58:23 +0000
commite567a5185e78fed5fbae373e5489e10e8aa18a96 (patch)
treeef065169d1b33c8135aa75f44fa017a8ca0501a8
parent18a467cb55b7cfbf4f0348c2d84f0b577d8c952a (diff)
Set destructed vector into an invalid state, such that
subsequent calls to begin(), end(), size(), etc. all throw logic_error. Google ref b/7248326 git-svn-id: https://gcc.gnu.org/svn/gcc/branches/google/integration@195374 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index e571a637b19..70dd9a85c18 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -159,7 +159,12 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
~_Vector_base()
{ _M_deallocate(this->_M_impl._M_start, this->_M_impl._M_end_of_storage
- - this->_M_impl._M_start); }
+ - this->_M_impl._M_start);
+#if __google_stl_debug_dangling_vector
+ this->_M_impl._M_start = 0;
+ this->_M_impl._M_finish = reinterpret_cast<_Tp*>(~0UL);
+#endif
+ }
public:
_Vector_impl _M_impl;