Skip to content

Foundation fixes for 32-bit systems and more #264

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 6 commits into from
Feb 25, 2016
Merged

Foundation fixes for 32-bit systems and more #264

merged 6 commits into from
Feb 25, 2016

Conversation

hpux735
Copy link
Contributor

@hpux735 hpux735 commented Feb 21, 2016

This is a collection of fixes that address some edge cases relating to 32-bit systems, differing alignments, uninitialized locales, and incomplete paths.

@hpux735
Copy link
Contributor Author

hpux735 commented Feb 21, 2016

cc @tienex

@@ -1202,7 +1202,7 @@ CFNumberRef CFNumberCreate(CFAllocatorRef allocator, CFNumberType type, const vo
}
}

CFIndex size = 8 + ((!__CFNumberTypeTable[type].floatBit && __CFNumberTypeTable[type].storageBit) ? 8 : 0);
CFIndex size = (sizeof(struct __CFNumber) - sizeof(CFRuntimeBase)) + ((!__CFNumberTypeTable[type].floatBit && __CFNumberTypeTable[type].storageBit) ? 8 : 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, this seems to work just fine on 32 bit linked processes; I will have to do some digging to verify that...
The change listed here actually looks more correct.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Linux/arm the alignment is different, the _pad is found at 24, while CFRuntimeBase is 20 bytes long leading to an awful heap overflow.

@hpux735
Copy link
Contributor Author

hpux735 commented Feb 24, 2016

@phausler I'm just checking up on a few pending PRs that I have... Is there anything on this one that you need me to fix? (sorry to be a pest)

@phausler
Copy link
Contributor

everything checks out

phausler added a commit that referenced this pull request Feb 25, 2016
Foundation fixes for 32-bit systems and more
@phausler phausler merged commit 842383a into swiftlang:master Feb 25, 2016
@hpux735
Copy link
Contributor Author

hpux735 commented Feb 25, 2016

Thanks!

atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
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.

3 participants