Commit c543b18a by François Dumont Committed by François Dumont

string (basic_string::insert): Add iterator check and pass normal iterator to normal insert.

2011-02-19  François Dumont  <francois.cppdevs@free.fr>

        * include/debug/string (basic_string::insert): Add iterator check and
        pass normal iterator to normal insert.
        * include/debug/macros.h (__glibcxx_check_heap,
        __glibcxx_check_heap_pred): Remove __glibcxx_check_valid_range,
        already done.

From-SVN: r170322
parent becf4c11
2011-02-19 François Dumont <francois.cppdevs@free.fr>
* include/debug/string (basic_string::insert): Add iterator check and
pass normal iterator to normal insert.
* include/debug/macros.h (__glibcxx_check_heap,
__glibcxx_check_heap_pred): Remove __glibcxx_check_valid_range,
already done.
2011-02-17 Paolo Carlini <paolo.carlini@oracle.com> 2011-02-17 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/47776 PR libstdc++/47776
......
...@@ -286,7 +286,6 @@ _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(_First, _Last, \ ...@@ -286,7 +286,6 @@ _GLIBCXX_DEBUG_VERIFY(__gnu_debug::__check_partitioned_upper(_First, _Last, \
// Verify that the iterator range [_First, _Last) is a heap // Verify that the iterator range [_First, _Last) is a heap
#define __glibcxx_check_heap(_First,_Last) \ #define __glibcxx_check_heap(_First,_Last) \
__glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last), \ _GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last), \
_M_message(__gnu_debug::__msg_not_heap) \ _M_message(__gnu_debug::__msg_not_heap) \
._M_iterator(_First, #_First) \ ._M_iterator(_First, #_First) \
...@@ -295,7 +294,6 @@ _GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last), \ ...@@ -295,7 +294,6 @@ _GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last), \
/** Verify that the iterator range [_First, _Last) is a heap /** Verify that the iterator range [_First, _Last) is a heap
w.r.t. the predicate _Pred. */ w.r.t. the predicate _Pred. */
#define __glibcxx_check_heap_pred(_First,_Last,_Pred) \ #define __glibcxx_check_heap_pred(_First,_Last,_Pred) \
__glibcxx_check_valid_range(_First,_Last); \
_GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last, _Pred), \ _GLIBCXX_DEBUG_VERIFY(std::__is_heap(_First, _Last, _Pred), \
_M_message(__gnu_debug::__msg_not_heap_pred) \ _M_message(__gnu_debug::__msg_not_heap_pred) \
._M_iterator(_First, #_First) \ ._M_iterator(_First, #_First) \
......
...@@ -514,7 +514,8 @@ namespace __gnu_debug ...@@ -514,7 +514,8 @@ namespace __gnu_debug
void void
insert(iterator __p, std::initializer_list<_CharT> __l) insert(iterator __p, std::initializer_list<_CharT> __l)
{ {
_Base::insert(__p, __l); __glibcxx_check_insert(__p);
_Base::insert(__p.base(), __l);
this->_M_invalidate_all(); this->_M_invalidate_all();
} }
#endif // __GXX_EXPERIMENTAL_CXX0X__ #endif // __GXX_EXPERIMENTAL_CXX0X__
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment