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