This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: bounds checking in STL containers
- From: Florian Weimer <fweimer at redhat dot com>
- To: gcc at gcc dot gnu dot org
- Date: Tue, 16 Oct 2012 10:40:52 +0200
- Subject: Re: bounds checking in STL containers
- References: <19471350321281@web30g.yandex.ru>
On 10/15/2012 07:14 PM, ÐÑÑÐÐÐ ÐÐÑÐÐÑÑ wrote:
Two-three generations ago g++ was very cautious about consistency checking but not now.
Not sure if this is true. The at() member function performs such
checking, but not operator[].
We looked at bounds checking for operator[] under -D_FORTIFY_SOURCE, but
GCC isn't able to hoist the bounds check out of inner loops, so the
impact is pretty significant:
<http://gcc.gnu.org/ml/libstdc++/2012-06/msg00002.html>
--
Florian Weimer / Red Hat Product Security Team