[asan] fix 32-bit builds
authorKostya Serebryany <kcc@google.com>
Thu, 24 Jan 2013 10:43:50 +0000 (10:43 +0000)
committerKostya Serebryany <kcc@google.com>
Thu, 24 Jan 2013 10:43:50 +0000 (10:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173338 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Instrumentation/AddressSanitizer.cpp

index 477cb1a6533f64d7610acd844e2d3c4388a79878..0474eb516aa6de4f3adf5cab8a460a9e77d7bfec 100644 (file)
@@ -875,15 +875,15 @@ bool AddressSanitizerModule::runOnModule(Module &M) {
   Value *FirstDynamic = 0, *LastDynamic = 0;
 
   for (size_t i = 0; i < n; i++) {
-    static const size_t kMaxGlobalRedzone = 1 << 18;
+    static const uint64_t kMaxGlobalRedzone = 1 << 18;
     GlobalVariable *G = GlobalsToChange[i];
     PointerType *PtrTy = cast<PointerType>(G->getType());
     Type *Ty = PtrTy->getElementType();
     uint64_t SizeInBytes = TD->getTypeAllocSize(Ty);
-    size_t MinRZ = RedzoneSize();
+    uint64_t MinRZ = RedzoneSize();
     // MinRZ <= RZ <= kMaxGlobalRedzone
     // and trying to make RZ to be ~ 1/4 of SizeInBytes.
-    size_t RZ = std::max(MinRZ,
+    uint64_t RZ = std::max(MinRZ,
                          std::min(kMaxGlobalRedzone,
                                   (SizeInBytes / MinRZ / 4) * MinRZ));
     uint64_t RightRedzoneSize = RZ;