Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/SIL/Verifier/SILVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ struct ImmutableAddressUseVerifier {
case SILInstructionKind::FixLifetimeInst:
case SILInstructionKind::KeyPathInst:
case SILInstructionKind::SwitchEnumAddrInst:
case SILInstructionKind::SelectEnumAddrInst:
break;
case SILInstructionKind::AddressToPointerInst:
// We assume that the user is attempting to do something unsafe since we
Expand Down
17 changes: 17 additions & 0 deletions test/SIL/memory_lifetime.sil
Original file line number Diff line number Diff line change
Expand Up @@ -377,3 +377,20 @@ bb6(%45 : @owned $Error):
br bb4(%45 : $Error)
}

sil [ossa] @test_memory_lifetime_select_enum : $@convention(thin) (@in_guaranteed Optional<T>) -> () {
bb0(%0 : $*Optional<T>):
%2 = integer_literal $Builtin.Int1, 0
%3 = integer_literal $Builtin.Int1, 1
%4 = select_enum_addr %0 : $*Optional<T>, case #Optional.none!enumelt: %2, case #Optional.some!enumelt: %3 : $Builtin.Int1
cond_br %4, bb1, bb2

bb1:
br bb3

bb2:
br bb3

bb3:
%9999 = tuple()
return %9999 : $()
}