2002-01-29  Ben Collins  <bcollins@debian.org>

	* string/bits/string2.h (__mempcpy): Protect size arg for
	addition when using __builtin_memcpy.
This commit is contained in:
Ulrich Drepper 2002-01-29 19:07:57 +00:00
parent 207b66ceeb
commit 9d7810d8c5
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2002-01-29 Ben Collins <bcollins@debian.org>
* string/bits/string2.h (__mempcpy): Protect size arg for
addition when using __builtin_memcpy.
2002-01-29 Ulrich Drepper <drepper@redhat.com> 2002-01-29 Ulrich Drepper <drepper@redhat.com>
* stdlib/Makefile (tests): Add tst-qsort. * stdlib/Makefile (tests): Add tst-qsort.

View File

@ -202,7 +202,7 @@ __STRING2_COPY_TYPE (8);
# define __mempcpy(dest, src, n) \ # define __mempcpy(dest, src, n) \
(__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \ (__extension__ (__builtin_constant_p (src) && __builtin_constant_p (n) \
&& __string2_1bptr_p (src) && n <= 8 \ && __string2_1bptr_p (src) && n <= 8 \
? __builtin_memcpy (dest, src, n) + n \ ? __builtin_memcpy (dest, src, n) + (n) \
: __mempcpy (dest, src, n))) : __mempcpy (dest, src, n)))
# else # else
# define __mempcpy(dest, src, n) \ # define __mempcpy(dest, src, n) \