commit 5218b515fdb54881d8a2b87c28eb5fd84c52db01 Author: Jonathan Wakely Date: Tue Sep 27 16:22:28 2016 +0100 Fix lifetime of mutex lock in debug iterator * include/debug/safe_iterator.h (_Safe_iterator::operator++()): Fix lifetime of lock. diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h index 5368f3b..3f5a7f8 100644 --- a/libstdc++-v3/include/debug/safe_iterator.h +++ b/libstdc++-v3/include/debug/safe_iterator.h @@ -296,7 +296,7 @@ namespace __gnu_debug _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(), _M_message(__msg_bad_inc) ._M_iterator(*this, "this")); - __gnu_cxx::__scoped_lock(this->_M_get_mutex()); + __gnu_cxx::__scoped_lock __l(this->_M_get_mutex()); ++base(); return *this; }