@@ -305,7 +305,7 @@ class HWAddressSanitizer {
305
305
void tagAlloca (IRBuilder<> &IRB, AllocaInst *AI, Value *Tag, size_t Size);
306
306
Value *tagPointer (IRBuilder<> &IRB, Type *Ty, Value *PtrLong, Value *Tag);
307
307
Value *untagPointer (IRBuilder<> &IRB, Value *PtrLong);
308
- bool instrumentStack (memtag::StackInfo &Info, Value *StackTag,
308
+ bool instrumentStack (memtag::StackInfo &Info, Value *StackTag, Value *UARTag,
309
309
const DominatorTree &DT, const PostDominatorTree &PDT,
310
310
const LoopInfo &LI);
311
311
Value *readRegister (IRBuilder<> &IRB, StringRef Name);
@@ -1047,7 +1047,7 @@ Value *HWAddressSanitizer::getNextTagWithCall(IRBuilder<> &IRB) {
1047
1047
1048
1048
Value *HWAddressSanitizer::getStackBaseTag (IRBuilder<> &IRB) {
1049
1049
if (ClGenerateTagsWithCalls)
1050
- return getNextTagWithCall (IRB) ;
1050
+ return nullptr ;
1051
1051
if (StackBaseTag)
1052
1052
return StackBaseTag;
1053
1053
// Extract some entropy from the stack pointer for the tags.
@@ -1276,7 +1276,7 @@ static bool isLifetimeIntrinsic(Value *V) {
1276
1276
}
1277
1277
1278
1278
bool HWAddressSanitizer::instrumentStack (memtag::StackInfo &SInfo,
1279
- Value *StackTag,
1279
+ Value *StackTag, Value *UARTag,
1280
1280
const DominatorTree &DT,
1281
1281
const PostDominatorTree &PDT,
1282
1282
const LoopInfo &LI) {
@@ -1342,7 +1342,6 @@ bool HWAddressSanitizer::instrumentStack(memtag::StackInfo &SInfo,
1342
1342
1343
1343
auto TagEnd = [&](Instruction *Node) {
1344
1344
IRB.SetInsertPoint (Node);
1345
- Value *UARTag = getUARTag (IRB);
1346
1345
// When untagging, use the `AlignedSize` because we need to set the tags
1347
1346
// for the entire alloca to zero. If we used `Size` here, we would
1348
1347
// keep the last granule tagged, and store zero in the last byte of the
@@ -1446,9 +1445,9 @@ void HWAddressSanitizer::sanitizeFunction(Function &F,
1446
1445
const DominatorTree &DT = FAM.getResult <DominatorTreeAnalysis>(F);
1447
1446
const PostDominatorTree &PDT = FAM.getResult <PostDominatorTreeAnalysis>(F);
1448
1447
const LoopInfo &LI = FAM.getResult <LoopAnalysis>(F);
1449
- Value *StackTag =
1450
- ClGenerateTagsWithCalls ? nullptr : getStackBaseTag (EntryIRB);
1451
- instrumentStack (SInfo, StackTag, DT, PDT, LI);
1448
+ Value *StackTag = getStackBaseTag (EntryIRB);
1449
+ Value *UARTag = getUARTag (EntryIRB);
1450
+ instrumentStack (SInfo, StackTag, UARTag, DT, PDT, LI);
1452
1451
}
1453
1452
1454
1453
// If we split the entry block, move any allocas that were originally in the
0 commit comments