[compiler-rt] r225641 - [ASan] Move the shadow on Windows 32-bit from 0x20000000 to 0x40000000

Timur Iskhodzhanov timurrrr at google.com
Mon Jan 12 09:38:59 PST 2015


Author: timurrrr
Date: Mon Jan 12 11:38:58 2015
New Revision: 225641

URL: http://llvm.org/viewvc/llvm-project?rev=225641&view=rev
Log:
[ASan] Move the shadow on Windows 32-bit from 0x20000000 to 0x40000000

Modified:
    compiler-rt/trunk/lib/asan/asan_mapping.h
    compiler-rt/trunk/test/asan/TestCases/Windows/shadow_mapping_failure.cc

Modified: compiler-rt/trunk/lib/asan/asan_mapping.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_mapping.h?rev=225641&r1=225640&r2=225641&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_mapping.h (original)
+++ compiler-rt/trunk/lib/asan/asan_mapping.h Mon Jan 12 11:38:58 2015
@@ -79,6 +79,13 @@
 // || `[0x48000000, 0x4bffffff]` || ShadowGap  ||
 // || `[0x40000000, 0x47ffffff]` || LowShadow  ||
 // || `[0x00000000, 0x3fffffff]` || LowMem     ||
+//
+// Default Windows/i386 mapping:
+// || `[0x60000000, 0xffffffff]` || HighMem    ||
+// || `[0x4c000000, 0x5fffffff]` || HighShadow ||
+// || `[0x48000000, 0x4bffffff]` || ShadowGap  ||
+// || `[0x40000000, 0x47ffffff]` || LowShadow  ||
+// || `[0x00000000, 0x3fffffff]` || LowMem     ||
 
 static const u64 kDefaultShadowScale = 3;
 static const u64 kDefaultShadowOffset32 = 1ULL << 29;  // 0x20000000
@@ -91,6 +98,7 @@ static const u64 kMIPS64_ShadowOffset64
 static const u64 kPPC64_ShadowOffset64 = 1ULL << 41;
 static const u64 kFreeBSD_ShadowOffset32 = 1ULL << 30;  // 0x40000000
 static const u64 kFreeBSD_ShadowOffset64 = 1ULL << 46;  // 0x400000000000
+static const u64 kWindowsShadowOffset32 = 1ULL << 30;  // 0x40000000
 
 #define SHADOW_SCALE kDefaultShadowScale
 #if SANITIZER_ANDROID
@@ -101,12 +109,12 @@ static const u64 kFreeBSD_ShadowOffset64
 #    define SHADOW_OFFSET kMIPS32_ShadowOffset32
 #  elif SANITIZER_FREEBSD
 #    define SHADOW_OFFSET kFreeBSD_ShadowOffset32
+#  elif SANITIZER_IOS
+#    define SHADOW_OFFSET kIosShadowOffset32
+#  elif SANITIZER_WINDOWS
+#    define SHADOW_OFFSET kWindowsShadowOffset32
 #  else
-#    if SANITIZER_IOS
-#      define SHADOW_OFFSET kIosShadowOffset32
-#    else
-#      define SHADOW_OFFSET kDefaultShadowOffset32
-#    endif
+#    define SHADOW_OFFSET kDefaultShadowOffset32
 #  endif
 # else
 #  if defined(__aarch64__)

Modified: compiler-rt/trunk/test/asan/TestCases/Windows/shadow_mapping_failure.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/shadow_mapping_failure.cc?rev=225641&r1=225640&r2=225641&view=diff
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Windows/shadow_mapping_failure.cc (original)
+++ compiler-rt/trunk/test/asan/TestCases/Windows/shadow_mapping_failure.cc Mon Jan 12 11:38:58 2015
@@ -3,7 +3,7 @@
 
 #include <stdio.h>
 
-char bigchunk[1 << 29];
+char bigchunk[1 << 30];
 
 int main() {
   printf("Hello, world!\n");





More information about the llvm-commits mailing list