This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] improve string find algorithm


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.


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