Skip to content

Commit 1b76312

Browse files
committed
Update some types after D110451
To fix mismatched size_t vs uint64_t on some platforms.
1 parent 7400865 commit 1b76312

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3323,7 +3323,7 @@ void FunctionStackPoisoner::processStaticAllocas() {
33233323

33243324
// Minimal header size (left redzone) is 4 pointers,
33253325
// i.e. 32 bytes on 64-bit platforms and 16 bytes in 32-bit platforms.
3326-
size_t Granularity = 1ULL << Mapping.Scale;
3326+
uint64_t Granularity = 1ULL << Mapping.Scale;
33273327
size_t MinHeaderSize = std::max((size_t)ASan.LongSize / 2, Granularity);
33283328
const ASanStackFrameLayout &L =
33293329
ComputeASanStackFrameLayout(SVD, Granularity, MinHeaderSize);

llvm/lib/Transforms/Utils/ASanStackFrameLayout.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static inline bool CompareVars(const ASanStackVariableDescription &a,
3333

3434
// We also force minimal alignment for all vars to kMinAlignment so that vars
3535
// with e.g. alignment 1 and alignment 16 do not get reordered by CompareVars.
36-
static const size_t kMinAlignment = 16;
36+
static const uint64_t kMinAlignment = 16;
3737

3838
// We want to add a full redzone after every variable.
3939
// The larger the variable Size the larger is the redzone.
@@ -52,7 +52,7 @@ static size_t VarAndRedzoneSize(size_t Size, size_t Granularity,
5252

5353
ASanStackFrameLayout
5454
ComputeASanStackFrameLayout(SmallVectorImpl<ASanStackVariableDescription> &Vars,
55-
size_t Granularity, size_t MinHeaderSize) {
55+
uint64_t Granularity, size_t MinHeaderSize) {
5656
assert(Granularity >= 8 && Granularity <= 64 &&
5757
(Granularity & (Granularity - 1)) == 0);
5858
assert(MinHeaderSize >= 16 && (MinHeaderSize & (MinHeaderSize - 1)) == 0 &&

0 commit comments

Comments
 (0)