This is the mail archive of the
mailing list for the libstdc++ project.
Re: [PATCH] improve string find algorithm
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Aditya Kumar <aditya dot k7 at samsung dot com>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, hiraditya at msn dot com
- Date: Fri, 6 Jan 2017 20:32:04 +0000
- Subject: Re: [PATCH] improve string find algorithm
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <20170106133502.GB2966@redhat.com>
On 06/01/17 13:35 +0000, Jonathan Wakely wrote:
I'm surprised we don't have any tests for this case, but apparently we
don't, as your patch passes all our tests.
My bad, we do have tests that FAIL with this patch, but only after a
'make clean' (otherwise the explicit instantiation definitions in the
library don't get rebuilt after applying the patch, so the tests use
the old code).
FAIL: 21_strings/basic_string/operations/find/char/1.cc execution test
FAIL: 21_strings/basic_string/operations/find/wchar_t/1.cc execution test
These fail on assert(s.find(s, 1) == std::string::npos) which gives
the wrong answer as explained in my previous mail.
The infinite loop caused by this patch isn't caught by any existing
tests, so I'll add a check for that.