1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

Fix x86-64 memchr for large lengths.

This commit is contained in:
Jakub Jelinek
2009-06-16 10:23:31 -07:00
committed by Ulrich Drepper
parent 435aa54b3b
commit fab8238de6
3 changed files with 17 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/* Test and measure memchr functions.
Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
Copyright (C) 1999, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Jakub Jelinek <jakub@redhat.com>, 1999.
@@ -144,7 +144,12 @@ do_random_tests (void)
}
if (pos < len)
result = (char *) (p + pos + align);
{
size_t r = random ();
if ((r & 31) == 0)
len = ~(uintptr_t) (p + align) - ((r >> 5) & 31);
result = (char *) (p + pos + align);
}
else
result = NULL;