[llvm] f181c66 - Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 3 03:05:48 PDT 2020


Author: Simon Pilgrim
Date: 2020-07-03T10:54:28+01:00
New Revision: f181c66c0306cc61a70d58c4c72d385f369088c7

URL: https://github.com/llvm/llvm-project/commit/f181c66c0306cc61a70d58c4c72d385f369088c7
DIFF: https://github.com/llvm/llvm-project/commit/f181c66c0306cc61a70d58c4c72d385f369088c7.diff

LOG: Fix MSVC "result of 32-bit shift implicitly converted to 64 bits" warning.

Added: 
    

Modified: 
    llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
index 8102c11f7b10..2e71d613714a 100644
--- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
@@ -731,8 +731,8 @@ bool HWAddressSanitizer::instrumentMemAccess(InterestingMemoryOperand &O) {
 
   IRBuilder<> IRB(O.getInsn());
   if (isPowerOf2_64(O.TypeSize) &&
-      (O.TypeSize / 8 <= (1UL << (kNumberOfAccessSizes - 1))) &&
-      (!O.Alignment || *O.Alignment >= (1UL << Mapping.Scale) ||
+      (O.TypeSize / 8 <= (1ULL << (kNumberOfAccessSizes - 1))) &&
+      (!O.Alignment || *O.Alignment >= (1ULL << Mapping.Scale) ||
        *O.Alignment >= O.TypeSize / 8)) {
     size_t AccessSizeIndex = TypeSizeToSizeIndex(O.TypeSize);
     if (ClInstrumentWithCalls) {


        


More information about the llvm-commits mailing list