diff options
author | Dehao Chen <dehao@google.com> | 2014-08-05 15:23:00 -0700 |
---|---|---|
committer | Dehao Chen <dehao@google.com> | 2014-08-05 18:09:01 -0700 |
commit | 7aa27e1c1a53afe28f6180fd1fc50d096cabea7b (patch) | |
tree | 6b7a71cda0388cd2932e3b2bdfa0c00ad2d77a5d /libc/include | |
parent | 1b1966d9448e979d1503a3d8843708bfa8880dc6 (diff) | |
download | bionic-7aa27e1c1a53afe28f6180fd1fc50d096cabea7b.zip bionic-7aa27e1c1a53afe28f6180fd1fc50d096cabea7b.tar.gz bionic-7aa27e1c1a53afe28f6180fd1fc50d096cabea7b.tar.bz2 |
Workaround b/16818336 which fails build under aggressive inlining.
Change-Id: Ifcd596714c427a2ec39502b9c0af9082ded91884
Diffstat (limited to 'libc/include')
-rw-r--r-- | libc/include/string.h | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/libc/include/string.h b/libc/include/string.h index af1c0c1..8df68e3 100644 --- a/libc/include/string.h +++ b/libc/include/string.h @@ -94,9 +94,6 @@ extern size_t strxfrm_l(char* __restrict, const char* __restrict, size_t, locale #if defined(__BIONIC_FORTIFY) -__errordecl(__memcpy_dest_size_error, "memcpy: prevented write past end of buffer"); -__errordecl(__memcpy_src_size_error, "memcpy: prevented read past end of buffer"); - __BIONIC_FORTIFY_INLINE void* memcpy(void* __restrict dest, const void* __restrict src, size_t copy_amount) { char *d = (char *) dest; @@ -104,14 +101,6 @@ void* memcpy(void* __restrict dest, const void* __restrict src, size_t copy_amou size_t s_len = __bos0(s); size_t d_len = __bos0(d); - if (__builtin_constant_p(copy_amount) && (copy_amount > d_len)) { - __memcpy_dest_size_error(); - } - - if (__builtin_constant_p(copy_amount) && (copy_amount > s_len)) { - __memcpy_src_size_error(); - } - return __builtin___memcpy_chk(dest, src, copy_amount, d_len); } @@ -130,16 +119,12 @@ char* strcpy(char* __restrict dest, const char* __restrict src) { return __builtin___strcpy_chk(dest, src, __bos(dest)); } -__errordecl(__stpncpy_error, "stpncpy: prevented write past end of buffer"); extern char* __stpncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t); __BIONIC_FORTIFY_INLINE char* stpncpy(char* __restrict dest, const char* __restrict src, size_t n) { size_t bos_dest = __bos(dest); size_t bos_src = __bos(src); - if (__builtin_constant_p(n) && (n > bos_dest)) { - __stpncpy_error(); - } if (bos_src == __BIONIC_FORTIFY_UNKNOWN_SIZE) { return __builtin___stpncpy_chk(dest, src, n, bos_dest); @@ -157,16 +142,12 @@ char* stpncpy(char* __restrict dest, const char* __restrict src, size_t n) { return __stpncpy_chk2(dest, src, n, bos_dest, bos_src); } -__errordecl(__strncpy_error, "strncpy: prevented write past end of buffer"); extern char* __strncpy_chk2(char* __restrict, const char* __restrict, size_t, size_t, size_t); __BIONIC_FORTIFY_INLINE char* strncpy(char* __restrict dest, const char* __restrict src, size_t n) { size_t bos_dest = __bos(dest); size_t bos_src = __bos(src); - if (__builtin_constant_p(n) && (n > bos_dest)) { - __strncpy_error(); - } if (bos_src == __BIONIC_FORTIFY_UNKNOWN_SIZE) { return __builtin___strncpy_chk(dest, src, n, bos_dest); @@ -201,7 +182,6 @@ void* memset(void *s, int c, size_t n) { extern size_t __strlcpy_real(char* __restrict, const char* __restrict, size_t) __asm__(__USER_LABEL_PREFIX__ "strlcpy"); -__errordecl(__strlcpy_error, "strlcpy: prevented write past end of buffer"); extern size_t __strlcpy_chk(char *, const char *, size_t, size_t); __BIONIC_FORTIFY_INLINE @@ -219,12 +199,6 @@ size_t strlcpy(char* __restrict dest, const char* __restrict src, size_t size) { if (__builtin_constant_p(size) && (size <= bos)) { return __strlcpy_real(dest, src, size); } - - // Compiler can prove, at compile time, that the passed in size - // is always > the actual object size. Force a compiler error. - if (__builtin_constant_p(size) && (size > bos)) { - __strlcpy_error(); - } #endif /* !defined(__clang__) */ return __strlcpy_chk(dest, src, size, bos); @@ -232,7 +206,6 @@ size_t strlcpy(char* __restrict dest, const char* __restrict src, size_t size) { extern size_t __strlcat_real(char* __restrict, const char* __restrict, size_t) __asm__(__USER_LABEL_PREFIX__ "strlcat"); -__errordecl(__strlcat_error, "strlcat: prevented write past end of buffer"); extern size_t __strlcat_chk(char* __restrict, const char* __restrict, size_t, size_t); @@ -251,12 +224,6 @@ size_t strlcat(char* __restrict dest, const char* __restrict src, size_t size) { if (__builtin_constant_p(size) && (size <= bos)) { return __strlcat_real(dest, src, size); } - - // Compiler can prove, at compile time, that the passed in size - // is always > the actual object size. Force a compiler error. - if (__builtin_constant_p(size) && (size > bos)) { - __strlcat_error(); - } #endif /* !defined(__clang__) */ return __strlcat_chk(dest, src, size, bos); |