[PATCH 2/4] Detect EOL on-the-fly in strstr, strcasestr and memmem.
H.J. Lu
hjl.tools@gmail.com
Fri Oct 5 19:23:00 GMT 2012
On Wed, May 30, 2012 at 2:10 AM, Maxim Kuvyrkov <maxim@codesourcery.com> wrote:
> [PATCH 2/4] Detect EOL on-the-fly in strstr, strcasestr and memmem.
>
> --
> Maxim Kuvyrkov
> CodeSourcery / Mentor Graphics
>
>
> [BZ #11607]
> * string/str-two-way.h (AVAILABLE1, AVAILABLE2, RET0_IF_0): New macros,
> define their defaults.
> (two_way_short_needle): Detect end-of-string on-the-fly.
> * string/strcasestr.c, string/strstr.c (AVAILABLE): Update.
> (AVAILABLE1, AVAILABLE2, RET0_IF_0, AVAILABLE_USES_J): Define.
> * string/bug-strcasestr1.c: New test.
> * string/Makefile: Run it.
This caused:
http://www.sourceware.org/bugzilla/show_bug.cgi?id=14602
I created hjl/pr14602 branch to add a testcase. On x86-64,
I got
/export/build/gnu/glibc/build-x86_64-linux/string/test-strstr: Wrong
result in function simple_strstr , enable_shared, (null)
/export/build/gnu/glibc/build-x86_64-linux/string/test-strstr-ifunc:
Wrong result in function simple_strstr , enable_shared, (null)
/export/build/gnu/glibc/build-x86_64-linux/string/test-strstr-ifunc:
Wrong result in function __strstr_sse2 , enable_shared, (null)
--
H.J.
More information about the Libc-alpha
mailing list