Open tayloraswift opened 2 years ago
i did binary search on this month’s nightlies, and found that the crash does not occur in any nightly up to and including DEVELOPMENT-SNAPSHOT-2022-08-18-a
. DEVELOPMENT-SNAPSHOT-2022-08-24-a
is the only affected nightly. so the regression must have taken place in the last ten days. :(
confirmed the crash is still occurring in DEVELOPMENT-SNAPSHOT-2022-08-30-a
. :(
confirmed the crash is still occurring in DEVELOPMENT-SNAPSHOT-2022-09-06-a
.
reduced the reproducer to
struct C<T> where T:AdditiveArithmetic
{
var x:[Int]
let y:T
init()
{
self.x = [0]
self.y = .zero
}
var z:Int
{
_read
{
yield self.x[0]
}
_modify
{
yield &self.x[0]
}
}
}
struct S
{
var c:C<Int>
init()
{
self.c = .init()
let _:Int = self.c.z
}
}
despite not being used anywhere, the y
member is required to cause the crash; without it no crash occurs.
rdar://100371186 (Issue #60841: LinearLifetimeChecker SIL verification found an ownership error in silgen emitConstructor)
Describe the bug
compiling the following test program crashes the compiler (and also sourcekit-lsp). the crash is new, i could not reproduce it on the 5.6.2 release toolchain, or the
DEVELOPMENT-SNAPSHOT-2022-08-01-a
nightly.Steps To Reproduce
test.swift
:swiftc test.swift
with a recent nightly:Expected behavior
the compiler should not crash.
Environment (please fill out the following information)
DEVELOPMENT-SNAPSHOT-2022-08-24-a