Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3 Fix usage of STACK_ALIGNBYTES in our local cha...



details:   https://anonhg.NetBSD.org/src/rev/a00ff1e7a964
branches:  trunk
changeset: 449793:a00ff1e7a964
user:      rin <rin%NetBSD.org@localhost>
date:      Sun Mar 24 00:23:59 2019 +0000

description:
Fix usage of STACK_ALIGNBYTES in our local change.

Tested on amd64 and i386:
- binaries generated by "gcc -fsanitize=address" work fine
- /usr/tests/usr.bin/{cc,c++}/t_asan_* do not fail

diffstat:

 external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc |  4 ++--
 external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc     |  4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r f3fbe7e80a20 -r a00ff1e7a964 external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc
--- a/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc       Sat Mar 23 23:15:11 2019 +0000
+++ b/external/gpl3/gcc.old/dist/libsanitizer/asan/asan_thread.cc       Sun Mar 24 00:23:59 2019 +0000
@@ -226,9 +226,9 @@
     return true;
   }
 #ifndef STACK_ALIGNBYTES
-# define STACK_ALIGNBYTES (~(SANITIZER_WORDSIZE/8 - 1))
+# define STACK_ALIGNBYTES (SANITIZER_WORDSIZE/8 - 1)
 #endif
-  uptr aligned_addr = addr & STACK_ALIGNBYTES; // align addr.
+  uptr aligned_addr = addr & ~STACK_ALIGNBYTES; // align addr.
   u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr);
   u8 *shadow_bottom = (u8*)MemToShadow(bottom);
 
diff -r f3fbe7e80a20 -r a00ff1e7a964 external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc
--- a/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc   Sat Mar 23 23:15:11 2019 +0000
+++ b/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc   Sun Mar 24 00:23:59 2019 +0000
@@ -301,9 +301,9 @@
     return true;
   }
 #ifndef STACK_ALIGNBYTES
-# define STACK_ALIGNBYTES (~(SANITIZER_WORDSIZE/8 - 1))
+# define STACK_ALIGNBYTES (SANITIZER_WORDSIZE/8 - 1)
 #endif
-  uptr aligned_addr = addr & STACK_ALIGNBYTES; // align addr.
+  uptr aligned_addr = addr & ~STACK_ALIGNBYTES; // align addr.
   u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr);
   u8 *shadow_bottom = (u8*)MemToShadow(bottom);
 



Home | Main Index | Thread Index | Old Index