This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: glibc-2.0.93: inlines for strstr on i486 badly broken
- To: Horst von Brand <vonbrand@sleipnir.valparaiso.cl>
- Subject: Re: glibc-2.0.93: inlines for strstr on i486 badly broken
- From: Ulrich Drepper <drepper@cygnus.com>
- Date: 19 May 1998 21:08:57 -0700
- Cc: libc-alpha@cygnus.com
- References: <199805200301.XAA00566@sleipnir.valparaiso.cl>
- Reply-To: drepper@cygnus.com (Ulrich Drepper)
Horst von Brand <vonbrand@sleipnir.valparaiso.cl> writes:
> The string inlines for __strstr_g() are missing the initialization of %edi
> to __needle, so every use of them segfaults. There are also unnecesary
> initial values for the fourth argument.
Thanks, I used a bit different method but the result should be the same.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Index: string.h
===================================================================
RCS file: /egcs/carton/cvsfiles/libc/sysdeps/i386/i486/bits/string.h,v
retrieving revision 1.14
diff -d -u -p -r1.14 string.h
--- string.h 1998/05/08 12:32:17 1.14
+++ string.h 1998/05/20 04:11:04
@@ -1530,7 +1530,8 @@ __strstr_g (__const char *__haystack, __
"2:\n\t"
"popl %%ebx"
: "=a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2)
- : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (0), "d" (__needle)
+ : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
+ "d" (__needle)
: "cc");
return __res;
}
@@ -1558,7 +1559,8 @@ __strstr_g (__const char *__haystack, __
"xorl %%eax,%%eax\n"
"2:"
: "=a" (__res), "=&c" (__d0), "=&S" (__d1), "=&D" (__d2), "=&d" (__d3)
- : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (0), "b" (__needle)
+ : "0" (0), "1" (0xffffffff), "2" (__haystack), "3" (__needle),
+ "b" (__needle)
: "cc");
return __res;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I don't know what I thought when using 0...
-- Uli
---------------. drepper at gnu.org ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com `------------------------