Skip to content

Address truncation in types #68253

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

Closed
wants to merge 2 commits into from
Closed

Conversation

compnerd
Copy link
Member

@compnerd compnerd commented Sep 1, 2023

We were truncating the parameter by using an incorrect parameter type in various locations. Adjust the types to account for 64-bit platforms which use LLP64.

`Swift.Int` is *NOT* `int` or `long`, it is `uintptr_t`.  Unfortunately,
we cannot include `stdint.h` here and thus cannot use `uintptr_t`.
Perhaps we should consider using `__swift_uintptr_t`.

For now, assume that we are always 64-bit and use `long long` and
`unsigned long long` which repairs the builds with non-LP64 targets.
@compnerd
Copy link
Member Author

compnerd commented Sep 1, 2023

CC: @DougGregor @bnbarham @rintaro

@compnerd
Copy link
Member Author

compnerd commented Sep 1, 2023

@swift-ci please test

`Swift.Int` is *NOT* `int` or `long`, it is `uintptr_t`.  Replace many
of the size parameters with `size_t`.
Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

I'm not overly familiar with CASTBridging related code but it doesn't look specific so looks good!

@compnerd compnerd mentioned this pull request Sep 1, 2023
9 tasks
@DougGregor
Copy link
Member

There's a more complete fix in #68278

@DougGregor DougGregor closed this Sep 1, 2023
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