Skip to content

On targets smaller than 64 bits, emit a compile-time error if withUnsafeTemporaryAllocation(of:capacity:) byte count overflows #39976

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

Conversation

grynspan
Copy link
Contributor

On 64-bit targets, if withUnsafeTemporaryAllocation(of:capacity:) is called with parameters that produce a byte count too large to fit in Int, a compile-time error is emitted. This change enables the same error for targets with smaller bit widths for Int (i.e. 32-bit.)

…afeTemporaryAllocation(of:capacity:) byte count overflows
@grynspan
Copy link
Contributor Author

@swift-ci please test

@grynspan grynspan requested a review from kubamracek October 29, 2021 15:21
Copy link
Member

@lorentey lorentey left a comment

Choose a reason for hiding this comment

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

Oh good catch!

@grynspan grynspan merged commit aa54818 into main Nov 1, 2021
@grynspan grynspan deleted the jgrynspan/temporary-allocation-compile-time-error-for-32-bit-overflow branch November 1, 2021 16:41
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