diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-07 02:43:16 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-12-07 02:43:16 +0000 |
commit | 558ebf1c6fd6a7a563082ae9778b62f7937e9c38 (patch) | |
tree | 0017d57efee841e17c2a97548a4eb96aaf02f384 /libstdc++-v3 | |
parent | 451d747704db9cdfe9e480d0b6e08a61b67ab420 (diff) | |
download | gcc-558ebf1c6fd6a7a563082ae9778b62f7937e9c38.tar.gz |
2010-12-06 Paul Pluzhnikov <ppluzhnikov@google.com>
PR libstdc++/46830
* include/ext/sso_string_base.h (__sso_string_base<>::_M_swap):
Early return when this == &__rcs.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167528 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 6 | ||||
-rw-r--r-- | libstdc++-v3/include/ext/sso_string_base.h | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 410743ec6b7..19bdd55f175 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2010-12-06 Paul Pluzhnikov <ppluzhnikov@google.com> + + PR libstdc++/46830 + * include/ext/sso_string_base.h (__sso_string_base<>::_M_swap): + Early return when this == &__rcs. + 2010-12-06 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/shared_ptr.h (shared_ptr<>::shared_ptr(_Tp1*, _Deleter, diff --git a/libstdc++-v3/include/ext/sso_string_base.h b/libstdc++-v3/include/ext/sso_string_base.h index 43d44528999..6168631826b 100644 --- a/libstdc++-v3/include/ext/sso_string_base.h +++ b/libstdc++-v3/include/ext/sso_string_base.h @@ -1,6 +1,7 @@ // Short-string-optimized versatile string base -*- C++ -*- -// Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +// Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 +// Free Software Foundation, Inc. // // This file is part of the GNU ISO C++ Library. This library is free // software; you can redistribute it and/or modify it under the @@ -232,6 +233,9 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx) __sso_string_base<_CharT, _Traits, _Alloc>:: _M_swap(__sso_string_base& __rcs) { + if (this == &__rcs) + return; + // _GLIBCXX_RESOLVE_LIB_DEFECTS // 431. Swapping containers with unequal allocators. std::__alloc_swap<_CharT_alloc_type>::_S_do_it(_M_get_allocator(), |