mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
Remove CHECK_BOUNDS_LOW and CHECK_BOUNDS_HIGH for C code.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2013-02-08 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
[BZ #13550]
|
||||||
|
* sysdeps/generic/bp-checks.h (CHECK_BOUNDS_LOW): Remove all
|
||||||
|
definitions.
|
||||||
|
(CHECK_BOUNDS_HIGH): Likewise.
|
||||||
|
* string/strcpy.c: Do not include <bp-checks.h>.
|
||||||
|
(strcpy): Do not use CHECK_BOUNDS_LOW and CHECK_BOUNDS_HIGH.
|
||||||
|
|
||||||
2013-02-07 Roland McGrath <roland@hack.frob.com>
|
2013-02-07 Roland McGrath <roland@hack.frob.com>
|
||||||
|
|
||||||
* nscd/nscd-client.h (__nscd_drop_map_ref):
|
* nscd/nscd-client.h (__nscd_drop_map_ref):
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <memcopy.h>
|
#include <memcopy.h>
|
||||||
#include <bp-checks.h>
|
|
||||||
|
|
||||||
#undef strcpy
|
#undef strcpy
|
||||||
|
|
||||||
@ -29,8 +28,8 @@ strcpy (dest, src)
|
|||||||
const char *src;
|
const char *src;
|
||||||
{
|
{
|
||||||
char c;
|
char c;
|
||||||
char *__unbounded s = (char *__unbounded) CHECK_BOUNDS_LOW (src);
|
char *__unbounded s = (char *__unbounded) src;
|
||||||
const ptrdiff_t off = CHECK_BOUNDS_LOW (dest) - s - 1;
|
const ptrdiff_t off = dest - s - 1;
|
||||||
size_t n;
|
size_t n;
|
||||||
|
|
||||||
do
|
do
|
||||||
@ -41,8 +40,6 @@ strcpy (dest, src)
|
|||||||
while (c != '\0');
|
while (c != '\0');
|
||||||
|
|
||||||
n = s - src;
|
n = s - src;
|
||||||
(void) CHECK_BOUNDS_HIGH (src + n);
|
|
||||||
(void) CHECK_BOUNDS_HIGH (dest + n);
|
|
||||||
|
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
@ -24,16 +24,6 @@
|
|||||||
|
|
||||||
# define BOUNDS_VIOLATED (__builtin_trap (), 0)
|
# define BOUNDS_VIOLATED (__builtin_trap (), 0)
|
||||||
|
|
||||||
/* Verify that pointer's value >= low. Return pointer value. */
|
|
||||||
# define CHECK_BOUNDS_LOW(ARG) \
|
|
||||||
(((__ptrvalue (ARG) < __ptrlow (ARG)) && BOUNDS_VIOLATED), \
|
|
||||||
__ptrvalue (ARG))
|
|
||||||
|
|
||||||
/* Verify that pointer's value < high. Return pointer value. */
|
|
||||||
# define CHECK_BOUNDS_HIGH(ARG) \
|
|
||||||
(((__ptrvalue (ARG) > __ptrhigh (ARG)) && BOUNDS_VIOLATED), \
|
|
||||||
__ptrvalue (ARG))
|
|
||||||
|
|
||||||
# define _CHECK_N(ARG, N, COND) \
|
# define _CHECK_N(ARG, N, COND) \
|
||||||
(((COND) \
|
(((COND) \
|
||||||
&& (__ptrvalue (ARG) < __ptrlow (ARG) \
|
&& (__ptrvalue (ARG) < __ptrlow (ARG) \
|
||||||
@ -56,8 +46,6 @@
|
|||||||
/* Do nothing if not compiling with -fbounded-pointers. */
|
/* Do nothing if not compiling with -fbounded-pointers. */
|
||||||
|
|
||||||
# define BOUNDS_VIOLATED
|
# define BOUNDS_VIOLATED
|
||||||
# define CHECK_BOUNDS_LOW(ARG) (ARG)
|
|
||||||
# define CHECK_BOUNDS_HIGH(ARG) (ARG)
|
|
||||||
# define CHECK_1(ARG) (ARG)
|
# define CHECK_1(ARG) (ARG)
|
||||||
# define CHECK_1_NULL_OK(ARG) (ARG)
|
# define CHECK_1_NULL_OK(ARG) (ARG)
|
||||||
# define CHECK_N(ARG, N) (ARG)
|
# define CHECK_N(ARG, N) (ARG)
|
||||||
|
Reference in New Issue
Block a user