Skip to content

Commit 1b31646

Browse files
authored
[DFSan] Change placeholders from undef to poison (llvm#131534)
Use `poison` to create dummy phi nodes instead of `undef`.
1 parent ccf2109 commit 1b31646

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3447,19 +3447,19 @@ void DFSanVisitor::visitPHINode(PHINode &PN) {
34473447
PN.getIterator());
34483448

34493449
// Give the shadow phi node valid predecessors to fool SplitEdge into working.
3450-
Value *UndefShadow = UndefValue::get(ShadowTy);
3450+
Value *PoisonShadow = PoisonValue::get(ShadowTy);
34513451
for (BasicBlock *BB : PN.blocks())
3452-
ShadowPN->addIncoming(UndefShadow, BB);
3452+
ShadowPN->addIncoming(PoisonShadow, BB);
34533453

34543454
DFSF.setShadow(&PN, ShadowPN);
34553455

34563456
PHINode *OriginPN = nullptr;
34573457
if (DFSF.DFS.shouldTrackOrigins()) {
34583458
OriginPN = PHINode::Create(DFSF.DFS.OriginTy, PN.getNumIncomingValues(), "",
34593459
PN.getIterator());
3460-
Value *UndefOrigin = UndefValue::get(DFSF.DFS.OriginTy);
3460+
Value *PoisonOrigin = PoisonValue::get(DFSF.DFS.OriginTy);
34613461
for (BasicBlock *BB : PN.blocks())
3462-
OriginPN->addIncoming(UndefOrigin, BB);
3462+
OriginPN->addIncoming(PoisonOrigin, BB);
34633463
DFSF.setOrigin(&PN, OriginPN);
34643464
}
34653465

0 commit comments

Comments
 (0)