[sanitizer] Since x32 runs under 64-bit kernel, GetKernelAreaSize should return 0
authorKostya Serebryany <kcc@google.com>
Wed, 4 Mar 2015 20:32:06 +0000 (20:32 +0000)
committerKostya Serebryany <kcc@google.com>
Wed, 4 Mar 2015 20:32:06 +0000 (20:32 +0000)
llvm-svn: 231283

compiler-rt/lib/sanitizer_common/sanitizer_posix.cc

index 21826e9..7233228 100644 (file)
@@ -48,7 +48,7 @@ uptr GetMmapGranularity() {
 #if SANITIZER_WORDSIZE == 32
 // Take care of unusable kernel area in top gigabyte.
 static uptr GetKernelAreaSize() {
-#if SANITIZER_LINUX
+#if SANITIZER_LINUX && !SANITIZER_X32
   const uptr gbyte = 1UL << 30;
 
   // Firstly check if there are writable segments
@@ -80,7 +80,7 @@ static uptr GetKernelAreaSize() {
   return gbyte;
 #else
   return 0;
-#endif  // SANITIZER_LINUX
+#endif  // SANITIZER_LINUX && !SANITIZER_X32
 }
 #endif  // SANITIZER_WORDSIZE == 32