Open
Description
Description
Using a recent local Swift toolchain build to build the swift-crypto
project on Windows with this PR fixing the Windows build, I hit a compiler crash. The code triggering the crash is this one, particularly, the second precondition referencing self.allocatedCapacity
:
// Copies some bytes into the buffer at the appropriate place. Does not update count: external code must do so.
@inlinable
/* private but inlinable */ func _copyBytes<C: Collection>(_ bytes: C, at offset: Int) where C.Element == UInt8 {
precondition(offset >= 0)
precondition(offset + bytes.count <= self.allocatedCapacity)
let byteRange = offset..<(offset + bytes.count)
self._withVeryUnsafeMutableBytes { backingPtr in
let dest = UnsafeMutableRawBufferPointer(rebasing: backingPtr[byteRange])
dest.copyBytes(from: bytes)
}
}
Command line + compiler output:
swift-crypto-sil-verification-failure.txt
Reproduction
Build swift-crypto on Windows with apple/swift-crypto#370 applied.
Stack dump
Unsymbolized.
Expected behavior
Toolchain does not crash.
Environment
Swift version 6.2-dev (LLVM ab6128e8887fcf8, Swift c6b7b1f)
Target: x86_64-unknown-windows-msvc
Build config: +assertions
Additional information
No response