-
Notifications
You must be signed in to change notification settings - Fork 210
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When trying to access a Data slice via a subscript, the program crashes with Signal 5. When I first copy the slice into new Data access works
To Reproduce
Sample code to reproduce the behavior.
import Foundation
let data = Data([0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D])
let slice = data[1 ..< 14]
let sliceNew = Data(slice)
let notCrashing = sliceNew[0]
print("Not crashing correct: \(notCrashing)")
let crashing = slice[0]
print("Crashing: \(crashing)")Expected behavior
We don't crash when we access the data slice
Configuration (please complete the following information):
Apple Swift version 6.2.1 (swift-6.2.1-RELEASE)
Target: arm64-apple-macosx26.0
Build config: +assertions
Darwin Felix-MacBook.local 25.1.0 Darwin Kernel Version 25.1.0: Mon Oct 20 19:32:41 PDT 2025; root:xnu-12377.41.6~2/RELEASE_ARM64_T6000 arm64
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working