Skip to content

Conversation

@iCharlesHu
Copy link
Contributor

The array _allBundles is lazily created when the first item is inserted into it in the _CFBundleAddToTablesLocked function. There’s a possibility that by the time _CFBundleCopyAllBundles is called, _allBundles hasn’t been initialized yet. In such cases, lazily initialize _allBundles.

resolves: rdar://150846072

@iCharlesHu iCharlesHu requested a review from parkera September 24, 2025 07:35
@iCharlesHu
Copy link
Contributor Author

@swift-ci please test

@iCharlesHu
Copy link
Contributor Author

@swift-ci please test Windows platform

…py it.

The array `_allBundles` is lazily created when the first item is inserted into it in the `_CFBundleAddToTablesLocked` function. There’s a possibility that by the time `_CFBundleCopyAllBundles` is called, `_allBundles` hasn’t been initialized yet. In such cases, lazily initialize `_allBundles`.

resolves: rdar://150846072
@iCharlesHu iCharlesHu force-pushed the charles/cf-is-swift-nil-deref branch from d708415 to 0bb3920 Compare October 28, 2025 03:40
@iCharlesHu
Copy link
Contributor Author

@swift-ci please test

@iCharlesHu iCharlesHu merged commit fd8b266 into swiftlang:main Oct 28, 2025
2 checks passed
@iCharlesHu iCharlesHu deleted the charles/cf-is-swift-nil-deref branch October 28, 2025 15:14
@parkera
Copy link
Contributor

parkera commented Oct 28, 2025

This may be worth cherry picking to 6.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants