Skip to content

Commit a614f2b

Browse files
committed
[StackProtector] Fix domtree verification in NewPM
Use DTU.getDomTree() to make sure the DTU if flushed.
1 parent e1c9c84 commit a614f2b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

llvm/lib/CodeGen/StackProtector.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ PreservedAnalyses StackProtectorPass::run(Function &F,
136136
bool Changed = InsertStackProtectors(TM, &F, DT ? &DTU : nullptr,
137137
Info.HasPrologue, Info.HasIRCheck);
138138
#ifdef EXPENSIVE_CHECKS
139-
assert((!DT || DT->verify(DominatorTree::VerificationLevel::Full)) &&
139+
assert((!DT ||
140+
DTU.getDomTree().verify(DominatorTree::VerificationLevel::Full)) &&
140141
"Failed to maintain validity of domtree!");
141142
#endif
142143

llvm/test/CodeGen/X86/stack-protector-atomicrmw-xchg.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
22
; RUN: opt -S -mtriple=x86_64-unknown-linux-gnu -passes=stack-protector < %s | FileCheck %s
3+
; RUN: opt -S -mtriple=x86_64-unknown-linux-gnu -passes='require<domtree>,stack-protector' < %s | FileCheck %s
34

45
define void @atomicrmw_xchg(ptr %p) sspstrong {
56
; CHECK-LABEL: define void @atomicrmw_xchg(

0 commit comments

Comments
 (0)