Update.
* sysdeps/i386/strchrnul.S: Fix bugs which let to wrong results in 25% of all cases.
This commit is contained in:
parent
68d7943fa2
commit
d8b29eea29
@ -1,5 +1,8 @@
|
|||||||
1999-04-30 Ulrich Drepper <drepper@cygnus.com>
|
1999-04-30 Ulrich Drepper <drepper@cygnus.com>
|
||||||
|
|
||||||
|
* sysdeps/i386/strchrnul.S: Fix bugs which let to wrong results in
|
||||||
|
25% of all cases.
|
||||||
|
|
||||||
* sysdeps/i386/i486/bits/string.h: Replace __uintXX_t types with
|
* sysdeps/i386/i486/bits/string.h: Replace __uintXX_t types with
|
||||||
base types.
|
base types.
|
||||||
|
|
||||||
|
@ -156,12 +156,12 @@ L(11): movl (%eax), %ecx /* get word (= 4 bytes) in question */
|
|||||||
addl %ecx, %edi /* add the magic value to the word. We get
|
addl %ecx, %edi /* add the magic value to the word. We get
|
||||||
carry bits reported for each byte which
|
carry bits reported for each byte which
|
||||||
is *not* 0 */
|
is *not* 0 */
|
||||||
jnc L(71) /* highest byte is NUL => return NULL */
|
jnc L(7) /* highest byte is NUL => return NULL */
|
||||||
xorl %ecx, %edi /* (word+magic)^word */
|
xorl %ecx, %edi /* (word+magic)^word */
|
||||||
orl $0xfefefeff, %edi /* set all non-carry bits */
|
orl $0xfefefeff, %edi /* set all non-carry bits */
|
||||||
incl %edi /* add 1: if one carry bit was *not* set
|
incl %edi /* add 1: if one carry bit was *not* set
|
||||||
the addition will not result in 0. */
|
the addition will not result in 0. */
|
||||||
jnz L(71) /* found NUL => return NULL */
|
jnz L(7) /* found NUL => return NULL */
|
||||||
|
|
||||||
movl 4(%eax), %ecx /* get word (= 4 bytes) in question */
|
movl 4(%eax), %ecx /* get word (= 4 bytes) in question */
|
||||||
xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c
|
xorl %edx, %ecx /* XOR with word c|c|c|c => bytes of str == c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user