mirror of
https://github.com/apple/swift.git
synced 2026-10-28 21:15:56 +01:00
The MoveOnlyChecker is inserting a `destroy_addr` in a read-only access scope, which is illegal. Relax the verification of read-only access scope by only looking at dynamic scopes. Fixes a verifier crash. rdar://166896665
18 lines
349 B
Plaintext
18 lines
349 B
Plaintext
// RUN: not --crash %target-sil-opt %s -o /dev/null
|
|
|
|
// REQUIRES: asserts
|
|
|
|
sil_stage canonical
|
|
|
|
import Builtin
|
|
import Swift
|
|
|
|
sil [ossa] @write_in_read_only_scope : $@convention(thin) (@inout Int, Int) -> () {
|
|
bb0(%0 : $*Int, %1 : $Int):
|
|
%2 = begin_access [read] [dynamic] %0
|
|
store %1 to [trivial] %0
|
|
end_access %2
|
|
%5 = tuple()
|
|
return %5
|
|
}
|