This is the mail archive of the
mailing list for the libstdc++ project.
Re: [patch] libstdc++/61086 - fix ubsan errors in std::vector
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>, libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 07 May 2014 14:21:36 +0200
- Subject: Re: [patch] libstdc++/61086 - fix ubsan errors in std::vector
- Authentication-results: sourceware.org; auth=none
- References: <20140507120743 dot GB18109 at redhat dot com>
On 05/07/2014 02:07 PM, Jonathan Wakely wrote:
Uhmm, I see, at the time I scratched my head a bit. Nice that we can
avoid the whole thing. Are we sure we don't have something similar
The testcase in the PR calls __position._M_const_cast() to get a
mutable iterator and that dereferences the pointer as suggested in
That's invalid because the pointer is not dereferenceable (in this
case it's null but is past-the-end at all times).