Module Name:    src
Committed By:   christos
Date:           Thu Jan 17 20:37:20 UTC 2019

Modified Files:
        src/external/gpl3/gcc/dist/libsanitizer/asan: asan_thread.cc

Log Message:
Use the proper stack aligment for the architecture. Fixes broken asan
tests on i386.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
    src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc
diff -u src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc:1.1.1.3 src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc:1.2
--- src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc:1.1.1.3	Thu Feb  1 20:58:47 2018
+++ src/external/gpl3/gcc/dist/libsanitizer/asan/asan_thread.cc	Thu Jan 17 15:37:20 2019
@@ -9,6 +9,10 @@
 //
 // Thread-related code.
 //===----------------------------------------------------------------------===//
+
+#define __EXPOSE_STACK
+#include <sys/param.h>
+
 #include "asan_allocator.h"
 #include "asan_interceptors.h"
 #include "asan_poisoning.h"
@@ -221,7 +225,10 @@ bool AsanThread::GetStackFrameAccessByAd
     access->frame_descr = (const char *)((uptr*)bottom)[1];
     return true;
   }
-  uptr aligned_addr = addr & ~(SANITIZER_WORDSIZE/8 - 1);  // align addr.
+#ifndef STACK_ALIGNBYTES
+# define STACK_ALIGNBYTES (~(SANITIZER_WORDSIZE/8 - 1))
+#endif
+  uptr aligned_addr = addr & STACK_ALIGNBYTES; // align addr.
   u8 *shadow_ptr = (u8*)MemToShadow(aligned_addr);
   u8 *shadow_bottom = (u8*)MemToShadow(bottom);
 

Reply via email to