This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 2/4] Detect EOL on-the-fly in strstr, strcasestr and memmem.
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Maxim Kuvyrkov <maxim at codesourcery dot com>
- Cc: "Carlos O'Donell" <carlos at codesourcery dot com>, GLIBC Devel <libc-alpha at sourceware dot org>, Eric Blake <eblake at redhat dot com>, Ryan Arnold <rsa at us dot ibm dot com>
- Date: Fri, 5 Oct 2012 12:23:34 -0700
- Subject: Re: [PATCH 2/4] Detect EOL on-the-fly in strstr, strcasestr and memmem.
- References: <2C516CF2-D083-4C1D-AD27-6A31D381D548@codesourcery.com><54BDEEA0-E48A-4562-89AD-FCB848BFB9CF@codesourcery.com>
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.