diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index 74f5d847627709..ad303d7a2240fd 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -3323,7 +3323,7 @@ void FunctionStackPoisoner::processStaticAllocas() { // Minimal header size (left redzone) is 4 pointers, // i.e. 32 bytes on 64-bit platforms and 16 bytes in 32-bit platforms. - size_t Granularity = 1ULL << Mapping.Scale; + uint64_t Granularity = 1ULL << Mapping.Scale; size_t MinHeaderSize = std::max((size_t)ASan.LongSize / 2, Granularity); const ASanStackFrameLayout &L = ComputeASanStackFrameLayout(SVD, Granularity, MinHeaderSize); diff --git a/llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp b/llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp index 01912297324a9d..c5f3c683458a46 100644 --- a/llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp +++ b/llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp @@ -33,7 +33,7 @@ static inline bool CompareVars(const ASanStackVariableDescription &a, // We also force minimal alignment for all vars to kMinAlignment so that vars // with e.g. alignment 1 and alignment 16 do not get reordered by CompareVars. -static const size_t kMinAlignment = 16; +static const uint64_t kMinAlignment = 16; // We want to add a full redzone after every variable. // The larger the variable Size the larger is the redzone. @@ -52,7 +52,7 @@ static size_t VarAndRedzoneSize(size_t Size, size_t Granularity, ASanStackFrameLayout ComputeASanStackFrameLayout(SmallVectorImpl &Vars, - size_t Granularity, size_t MinHeaderSize) { + uint64_t Granularity, size_t MinHeaderSize) { assert(Granularity >= 8 && Granularity <= 64 && (Granularity & (Granularity - 1)) == 0); assert(MinHeaderSize >= 16 && (MinHeaderSize & (MinHeaderSize - 1)) == 0 &&