This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, libstdc++/63497] Avoid dereferencing invalid iterator in regex_executor


On 22/10/14 14:53 -0700, Tim Shen wrote:
On Wed, Oct 22, 2014 at 7:34 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
Only if it's likely to catch problems in future. If you'd be putting
it in only to make a testcase fail then it's not worth it.

No, since I think with this patch _M_current is clearly valid when
being dereferenced.

You could even simplify it further using std::prev:

     if (_M_is_word(*std::prev(__pre)))
       __left_is_word = true;

Done.

OK to commit, thanks!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]