Blame SOURCES/glibc-rh1505492-bounded-7.patch

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