Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SR-439] Cached floating-point CF values do not bridge
If a bridged CF type is instantiated before __CFInitializeSwift() is called, then those types will not be bridged. This created unusual and unexpected results when initializing floating point numbers containing cached values such as 0.0, 1.0 and NaN: decoding a property list containing these would assert fail but other numbers would be fine. This patch fixes this bug by moving the initialization of CFNumber constants to a new function, __CFNumberInitialize(), which is called after the Swift bridge is initialized. This patch is enabled but should not regress non-Swift builds. CFNull and CFBooleans are instantiated before __CFInitializeSwift() is called; if these types are ever bridged then a similar fix must be made.
- Loading branch information
Showing
3 changed files
with
31 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters