[llvm] 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:
    llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp?rev=225641&r1=225640&r2=225641&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Mon Jan 12 11:38:58 2015
@@ -67,6 +67,7 @@ static const uint64_t kMIPS32_ShadowOffs
 static const uint64_t kMIPS64_ShadowOffset64 = 1ULL << 36;
 static const uint64_t kFreeBSD_ShadowOffset32 = 1ULL << 30;
 static const uint64_t kFreeBSD_ShadowOffset64 = 1ULL << 46;
+static const uint64_t kWindowsShadowOffset32 = 1ULL << 30;
 
 static const size_t kMinStackMallocSize = 1 << 6;  // 64B
 static const size_t kMaxStackMallocSize = 1 << 16;  // 64K
@@ -307,6 +308,7 @@ static ShadowMapping getShadowMapping(Tr
                   TargetTriple.getArch() == llvm::Triple::mipsel;
   bool IsMIPS64 = TargetTriple.getArch() == llvm::Triple::mips64 ||
                   TargetTriple.getArch() == llvm::Triple::mips64el;
+  bool IsWindows = TargetTriple.isOSWindows();
 
   ShadowMapping Mapping;
 
@@ -319,6 +321,8 @@ static ShadowMapping getShadowMapping(Tr
       Mapping.Offset = kFreeBSD_ShadowOffset32;
     else if (IsIOS)
       Mapping.Offset = kIOSShadowOffset32;
+    else if (IsWindows)
+      Mapping.Offset = kWindowsShadowOffset32;
     else
       Mapping.Offset = kDefaultShadowOffset32;
   } else {  // LongSize == 64





More information about the llvm-commits mailing list