-
Swift 6.2.4Swift 2026. 3. 22. 07:06
안녕하세요. 그린입니다 🍏
이번 포스팅에서는 Swift 6.2.4에서 릴리즈된 내용들을 정리해보겠습니다 🙋🏻

Intro
2026년 2월 27일, Swift 6.2.4가 공식 릴리즈되었습니다.
이번 릴리즈는 주로 버그 수정과 성능 개선에 초점을 맞춘 마이너 업데이트입니다.
Xcode 26.3에 Swift 6.2.4가 포함되어 있으며, Swiftly나 Docker를 통해서도 설치할 수 있습니다 🚀
설치 방법
Swiftly 사용
swiftly install 6.2.4 # 또는 swiftly install latest직접 다운로드
Swift.org에서 툴체인을 직접 다운로드할 수 있습니다.
Docker
Docker 이미지는 곧 hub.docker.com/_/swift에서 사용 가능합니다.
Xcode
Xcode 26.3에 Swift 6.2.4가 포함되어 있습니다.
주요 변경사항
Swift 컴파일러
1. for-in 루프의 break/continue 크래시 수정
PR: #86114
variadic generic 타입을 순회하는 for-in 루프에서 continue나 break 문을 사용할 때 런타임 크래시가 발생할 수 있는 문제를 수정했습니다.
컴파일러가 잘못된 jump destination을 선택하는 버그였습니다.
// 이제 정상적으로 동작합니다 for element in packExpansion { if someCondition { continue // 또는 break } }관련 이슈: Runtime crash (BAD_ACCESS) when iterating over a generic pack (tuple) #78598
2. nonisolated(nonsending) isolation 전달 개선
PR: #86112
nonisolated(nonsending) isolation이 이제 parent isolation을 가정하지 않는 closure로 전달됩니다.
특히 @Sendable 파라미터로 전달되는 closure에서 불필요한 isolation switch를 피할 수 있습니다.
@MainActor func test(_: nonisolated(nonsending) @Sendable () async -> Void) async {} await test { // The closure doesn't leave `@MainActor`. }이전에는 이런 closure가 @MainActor를 벗어났다가 다시 들어오는 불필요한 isolation switch가 발생했지만, 이제는 @MainActor를 유지합니다.
Swift Package Manager
1. 대량 소스 파일 선언 시 성능 개선
많은 수의 소스 파일을 명시적으로 선언하는 target을 빌드하거나 의존할 때 성능이 크게 개선되었습니다.
관련 이슈: Explicit source file declaration in Target's sources causes a performance degradation #9304
배경: swift-protobuf 1.33.1에서 모든 소스 파일을 명시적으로 선언하도록 변경했는데, 이로 인해 빌드 성능이 크게 저하되는 문제가 있었습니다.
SwiftPM이 각 파일에 대해 다른 모든 파일의 subpath인지 확인하는 O(n²) 연산을 수행했기 때문입니다.
이번 릴리즈에서 이 부분이 최적화되었습니다.
2. 의존성 체인의 default traits 처리 개선
의존성 체인 전반에서 default traits가 올바르게 활성화되도록 처리가 개선되었습니다.
관련 이슈: Package with enabled traits in dependency chain fails to resolve #9286
swift-corelibs-foundation
NSString의 buffer overflow 수정
PR: #5287
NSString의 getBytes 메서드에서 buffer overflow가 발생할 수 있는 심각한 버그를 수정했습니다.
문제: _NSCFString.getBytes가 제공된 max buffer length를 읽거나 존중하지 않아서, 충분하지 않은 크기의 buffer가 제공되면 buffer overflow가 발생했습니다.
특히 plutil에서 긴 유니코드 문자열이 포함된 plist를 읽을 때 증상이 나타났습니다.
UTF16 count는 stack buffer를 사용할 만큼 작았지만, UTF8 count는 충분히 커서 stack buffer를 overflow시켰습니다.
해결: 이제 byte iteration 중 max buffer length에 도달하면 중단하도록 개선된 bounds checking이 추가되었습니다.
관련 이슈: Segmentation fault when Linux plutil tries to convert a single non-ascii string #5284
swift-format
nonisolated(nonsending) 포맷팅 수정
PR: #1124
nonisolated(nonsending) type modifier가 이제 올바르게 포맷팅됩니다.
// 이제 제대로 포맷팅됩니다 func example(_: nonisolated(nonsending) @Sendable () async -> Void) async { // ... }
위험도 평가
모든 변경사항은 Low Risk로 평가되었습니다.
- for-in 크래시 수정: variadic generic을 순회하는 루프 내부의 break/continue에만 영향
- nonisolated(nonsending) 전달: @Sendable 파라미터이면서 nonisolated(nonsending)인 isolation boundary closure에만 영향
- SPM 성능: 명시적으로 선언된 소스 파일이 많은 경우에만 해당
- NSString 수정: buffer overflow 취약점 수정으로 안정성 향상
Conclusion
Swift 6.2.4는 크리티컬한 버그 수정과 성능 개선을 포함한 안정화 릴리즈입니다.
특히 NSString의 buffer overflow 수정은 보안 측면에서 중요한 개선이고, SPM의 성능 개선은 대규모 프로젝트에서 체감할 수 있을 것 같습니다.
nonisolated(nonsending)의 isolation 전달 개선도 Swift Concurrency를 사용하는 코드의 성능을 향상시켜줄 것으로 기대됩니다.
Xcode 26.3을 사용하고 계시다면 이미 Swift 6.2.4를 사용하고 계신 거니, 별도로 업데이트할 필요는 없습니다 😃
References
Announcing Swift 6.2.4
We are happy to announce the release of Swift 6.2.4. Install Swift Toolchain Install via Swiftly swiftly install 6.2.4 or swiftly install latest Download toolchain directly from Install Swift | Swift.org Docker images will be available on hub.docker.com/_/
forums.swift.org
Swift.org
Swift is a general-purpose programming language built using a modern approach to safety, performance, and software design patterns.
www.swift.org
swift - Official Image | Docker Hub
Docker Official Images are a curated set of Docker open source and drop-in solution repositories. Why Official Images? These images have clear documentation, promote best practices, and are designed for the most common use cases.
hub.docker.com:443
'Swift' 카테고리의 다른 글
[SE-0515] Allow reduce to produce noncopyable results (1) 2026.03.14 [SE-0514] Hashable Conformance for Dictionary.Keys, CollectionOfOne and EmptyCollection (0) 2026.03.02 [SE-0510] Introduce Dictionary.mapValuesWithKeys (0) 2026.02.21 [SE-0508] Array expression trailing closures (0) 2026.02.14 [SE-0507] Borrow and Mutate Accessors (0) 2026.02.08