Skip to content

Commit fa35b0a

Browse files
authored
Merge pull request swiftlang#35032 from gottesmm/pr-9d2d0740b16985e441b6396a97db774b30ce227e
[sil] Teach the verifier that an upcast of an address isn't a consuming use.
2 parents 678612a + 743fdb1 commit fa35b0a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/SIL/Verifier/SILVerifier.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ struct ImmutableAddressUseVerifier {
493493
return false;
494494
}
495495

496-
bool isCastToNonConsuming(UncheckedAddrCastInst *i) {
496+
bool isAddrCastToNonConsuming(SingleValueInstruction *i) {
497497
// Check if any of our uses are consuming. If none of them are consuming, we
498498
// are good to go.
499499
return llvm::none_of(i->getUses(), [&](Operand *use) -> bool {
@@ -588,8 +588,9 @@ struct ImmutableAddressUseVerifier {
588588
break;
589589
case SILInstructionKind::DestroyAddrInst:
590590
return true;
591+
case SILInstructionKind::UpcastInst:
591592
case SILInstructionKind::UncheckedAddrCastInst: {
592-
if (isCastToNonConsuming(cast<UncheckedAddrCastInst>(inst))) {
593+
if (isAddrCastToNonConsuming(cast<SingleValueInstruction>(inst))) {
593594
break;
594595
}
595596
return true;

0 commit comments

Comments
 (0)