[llvm] r273269 - This is part of the effort for asan to support Windows 64 bit.

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 08:07:29 PDT 2016


Author: etienneb
Date: Tue Jun 21 10:07:29 2016
New Revision: 273269

URL: http://llvm.org/viewvc/llvm-project?rev=273269&view=rev
Log:
This is part of the effort for asan to support Windows 64 bit.
The large offset is being tested on Windows 10 (which has larger usable
virtual address space than Windows 8 or earlier)

Patch by:  Wei Wang
Differential Revision: http://reviews.llvm.org/D21523


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=273269&r1=273268&r2=273269&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp (original)
+++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Tue Jun 21 10:07:29 2016
@@ -78,6 +78,8 @@ static const uint64_t kAArch64_ShadowOff
 static const uint64_t kFreeBSD_ShadowOffset32 = 1ULL << 30;
 static const uint64_t kFreeBSD_ShadowOffset64 = 1ULL << 46;
 static const uint64_t kWindowsShadowOffset32 = 3ULL << 28;
+// TODO(wwchrome): Experimental for asan Win64, may change.
+static const uint64_t kWindowsShadowOffset64 = 0x1ULL << 45;  // 32TB.
 
 static const size_t kMinStackMallocSize = 1 << 6;   // 64B
 static const size_t kMaxStackMallocSize = 1 << 16;  // 64K
@@ -396,6 +398,8 @@ static ShadowMapping getShadowMapping(Tr
         Mapping.Offset = kLinuxKasan_ShadowOffset64;
       else
         Mapping.Offset = kSmallX86_64ShadowOffset;
+    } else if (IsWindows && IsX86_64) {
+      Mapping.Offset = kWindowsShadowOffset64;
     } else if (IsMIPS64)
       Mapping.Offset = kMIPS64_ShadowOffset64;
     else if (IsIOS)




More information about the llvm-commits mailing list