Skip to content

Commit fe6e879

Browse files
committed
Remove the default DEBlocks = nullptr argument from verifyOwnership.
Passing nullptr was undefined behavior because ReborrowVerifier takes a reference to DeadEndBlocks.
1 parent fd1fd25 commit fe6e879

File tree

3 files changed

+5
-12
lines changed

3 files changed

+5
-12
lines changed

include/swift/SIL/SILFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1106,7 +1106,7 @@ class SILFunction
11061106
/// NOTE: The ownership verifier is always run when performing normal IR
11071107
/// verification, so this verification can be viewed as a subset of
11081108
/// SILFunction::verify.
1109-
void verifyOwnership(DeadEndBlocks *deadEndBlocks = nullptr) const;
1109+
void verifyOwnership(DeadEndBlocks *deadEndBlocks) const;
11101110

11111111
/// Verify that all non-cond-br critical edges have been split.
11121112
///

include/swift/SIL/SILValue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ class SILValue {
568568
ValueOwnershipKind getOwnershipKind() const;
569569

570570
/// Verify that this SILValue and its uses respects ownership invariants.
571-
void verifyOwnership(DeadEndBlocks *DEBlocks = nullptr) const;
571+
void verifyOwnership(DeadEndBlocks *DEBlocks) const;
572572
};
573573

574574
inline bool ValueOwnershipKind::isCompatibleWith(SILValue other) const {

lib/SIL/Verifier/SILOwnershipVerifier.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -772,16 +772,9 @@ verifySILValueHelper(const SILFunction *f, SILValue value,
772772
return;
773773

774774
SmallPtrSet<SILBasicBlock *, 32> liveBlocks;
775-
if (deadEndBlocks) {
776-
SILValueOwnershipChecker(*deadEndBlocks, value, errorBuilder, liveBlocks,
777-
reborrowVerifier)
778-
.check();
779-
} else {
780-
DeadEndBlocks deadEndBlocks(f);
781-
SILValueOwnershipChecker(deadEndBlocks, value, errorBuilder, liveBlocks,
782-
reborrowVerifier)
783-
.check();
784-
}
775+
SILValueOwnershipChecker(*deadEndBlocks, value, errorBuilder, liveBlocks,
776+
reborrowVerifier)
777+
.check();
785778
}
786779

787780
void SILValue::verifyOwnership(DeadEndBlocks *deadEndBlocks) const {

0 commit comments

Comments
 (0)