[compiler-rt] r182351 - [sanitizer] fix asan on the platforms where the page size is not a compile-time constant (or at least where EXEC_PAGESIZE may not be trustworthy), e.g. powerpc64.

Kostya Serebryany kcc at google.com
Mon May 20 23:15:50 PDT 2013


Author: kcc
Date: Tue May 21 01:15:50 2013
New Revision: 182351

URL: http://llvm.org/viewvc/llvm-project?rev=182351&view=rev
Log:
[sanitizer] fix asan on the platforms where the page size is not a compile-time constant (or at least where EXEC_PAGESIZE may not be trustworthy), e.g. powerpc64. 

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc?rev=182351&r1=182350&r2=182351&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_linux.cc Tue May 21 01:15:50 2013
@@ -614,7 +614,11 @@ bool ThreadLister::GetDirectoryEntries()
 }
 
 uptr GetPageSize() {
+#if defined(__x86_64__) || defined(__i386__)
   return EXEC_PAGESIZE;
+#else
+  return sysconf(_SC_PAGESIZE);  // EXEC_PAGESIZE may not be trustworthy.
+#endif
 }
 
 // Match full names of the form /path/to/base_name{-,.}*





More information about the llvm-commits mailing list