|
|
00db10 |
commit b2c9eff43c49d528c7ad3d0d91d03ccf0ae5ae0f
|
|
|
00db10 |
Author: Joseph Myers <joseph@codesourcery.com>
|
|
|
00db10 |
Date: Fri Feb 8 01:10:40 2013 +0000
|
|
|
00db10 |
|
|
|
00db10 |
Remove CHECK_BOUNDS_LOW and CHECK_BOUNDS_HIGH for C code.
|
|
|
00db10 |
|
|
|
00db10 |
diff --git a/string/strcpy.c b/string/strcpy.c
|
|
|
00db10 |
index acc580ba3edb3073..812de20a3732cce5 100644
|
|
|
00db10 |
--- a/string/strcpy.c
|
|
|
00db10 |
+++ b/string/strcpy.c
|
|
|
00db10 |
@@ -18,7 +18,6 @@
|
|
|
00db10 |
#include <stddef.h>
|
|
|
00db10 |
#include <string.h>
|
|
|
00db10 |
#include <memcopy.h>
|
|
|
00db10 |
-#include <bp-checks.h>
|
|
|
00db10 |
|
|
|
00db10 |
#undef strcpy
|
|
|
00db10 |
|
|
|
00db10 |
@@ -29,8 +28,8 @@ strcpy (dest, src)
|
|
|
00db10 |
const char *src;
|
|
|
00db10 |
{
|
|
|
00db10 |
char c;
|
|
|
00db10 |
- char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src);
|
|
|
00db10 |
- const ptrdiff_t off = CHECK_BOUNDS_LOW (dest) - s - 1;
|
|
|
00db10 |
+ char *__unbounded s = (char *__unbounded) src;
|
|
|
00db10 |
+ const ptrdiff_t off = dest - s - 1;
|
|
|
00db10 |
size_t n;
|
|
|
00db10 |
|
|
|
00db10 |
do
|
|
|
00db10 |
@@ -41,8 +40,6 @@ strcpy (dest, src)
|
|
|
00db10 |
while (c != '\0');
|
|
|
00db10 |
|
|
|
00db10 |
n = s - src;
|
|
|
00db10 |
- (void) CHECK_BOUNDS_HIGH (src + n);
|
|
|
00db10 |
- (void) CHECK_BOUNDS_HIGH (dest + n);
|
|
|
00db10 |
|
|
|
00db10 |
return dest;
|
|
|
00db10 |
}
|
|
|
00db10 |
diff --git a/sysdeps/generic/bp-checks.h b/sysdeps/generic/bp-checks.h
|
|
|
00db10 |
index bf10617a3f6b8474..980f3b68a84df8cf 100644
|
|
|
00db10 |
--- a/sysdeps/generic/bp-checks.h
|
|
|
00db10 |
+++ b/sysdeps/generic/bp-checks.h
|
|
|
00db10 |
@@ -24,16 +24,6 @@
|
|
|
00db10 |
|
|
|
00db10 |
# define BOUNDS_VIOLATED (__builtin_trap (), 0)
|
|
|
00db10 |
|
|
|
00db10 |
-/* Verify that pointer's value >= low. Return pointer value. */
|
|
|
00db10 |
-# define CHECK_BOUNDS_LOW(ARG) \
|
|
|
00db10 |
- (((__ptrvalue (ARG) < __ptrlow (ARG)) && BOUNDS_VIOLATED), \
|
|
|
00db10 |
- __ptrvalue (ARG))
|
|
|
00db10 |
-
|
|
|
00db10 |
-/* Verify that pointer's value < high. Return pointer value. */
|
|
|
00db10 |
-# define CHECK_BOUNDS_HIGH(ARG) \
|
|
|
00db10 |
- (((__ptrvalue (ARG) > __ptrhigh (ARG)) && BOUNDS_VIOLATED), \
|
|
|
00db10 |
- __ptrvalue (ARG))
|
|
|
00db10 |
-
|
|
|
00db10 |
# define _CHECK_N(ARG, N, COND) \
|
|
|
00db10 |
(((COND) \
|
|
|
00db10 |
&& (__ptrvalue (ARG) < __ptrlow (ARG) \
|
|
|
00db10 |
@@ -56,8 +46,6 @@
|
|
|
00db10 |
/* Do nothing if not compiling with -fbounded-pointers. */
|
|
|
00db10 |
|
|
|
00db10 |
# define BOUNDS_VIOLATED
|
|
|
00db10 |
-# define CHECK_BOUNDS_LOW(ARG) (ARG)
|
|
|
00db10 |
-# define CHECK_BOUNDS_HIGH(ARG) (ARG)
|
|
|
00db10 |
# define CHECK_1(ARG) (ARG)
|
|
|
00db10 |
# define CHECK_1_NULL_OK(ARG) (ARG)
|
|
|
00db10 |
# define CHECK_N(ARG, N) (ARG)
|