Skip to content

[SR-71] Repair NSNumber behaviour #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 6, 2015
Merged

[SR-71] Repair NSNumber behaviour #52

merged 3 commits into from
Dec 6, 2015

Conversation

argon
Copy link
Contributor

@argon argon commented Dec 6, 2015

During initalization store the number type in the CFInfo bitfield in the
same way that CFNumberCreate does.

NSNumber/CFNumber stores its value in a UInt64 (_pad) with associated type
information as part of the CFInfo bitfield. NSNUmber Initialization is
performed through _CFNumberInit which copies the value bytes into _pad but
does not store the type information. This leads to broken behaviour when
converting between type repesentations. i.e. Double -> NSNumber ->
Integer.

Fixes: https://bugs.swift.org/browse/SR-71

argon added 3 commits December 6, 2015 13:14
During initalization store the number type in the CFInfo bitfield in the
same way that CFNumberCreate does.

NSNumber/CFNumber stores its value in a UInt64 (_pad) with associated type
information as part of the CFInfo bitfield. NSNUmber Initialization is
performed through _CFNumberInit which copies the value bytes into _pad but
does not store the type information. This leads to broken behaviour when
converting between type repesentations. i.e. Double -> NSNumber ->
Integer.
@parkera
Copy link
Contributor

parkera commented Dec 6, 2015

Looks great, thanks.

parkera added a commit that referenced this pull request Dec 6, 2015
@parkera parkera merged commit def84d9 into swiftlang:master Dec 6, 2015
@argon argon deleted the hotfix/repair-NSNumber branch December 6, 2015 17:07
atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Apr 29, 2021
Update swift-package tests from Compile -> Compiling
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