Skip to content

Reflection: try holding 32/64 address offset in target machine pointers. #22899

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 1 commit into from
Feb 27, 2019

Conversation

drodriguez
Copy link
Contributor

When compiling for a 32 bit machine, uintptr_t from ReflectionInfo will
be the integer sized to hold a 32 bit pointer, so a 64 bit pointer might
not fit.

This commit removes the solution in
0f20c48 and does a runtime check that
the calculated offset will fit into the target machine uintptr_t, which
might not be true for 32 bits machines trying to read 64 bits images,
which should not be that common (and those images have to have offsets
bigger than what a 32 bits number can hold).

This broke the Android ARMv7 CI build: https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android/1858/

/cc @compnerd hopefully this will not have a problem in cl.exe?

@drodriguez drodriguez requested a review from compnerd February 25, 2019 21:55
…ll architectures.

When compiling for a 32 bit machine, uintptr_t from ReflectionInfo will
be the integer sized to hold a 32 bit pointer, so a 64 bit pointer might
not fit.

This commit removes the solution in
0f20c48 and does a runtime check that
the calculated offset will fit into the target machine uintptr_t, which
might not be true for 32 bits machines trying to read 64 bits images,
which should not be that common (and those images have to have offsets
bigger than what a 32 bits number can hold).
@drodriguez drodriguez force-pushed the reflection-context-fix-2 branch from 3e29fd0 to 8bee95d Compare February 26, 2019 21:32
Copy link
Contributor

@jckarter jckarter left a comment

Choose a reason for hiding this comment

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

This looks good, thanks!

@drodriguez
Copy link
Contributor Author

Thanks! I don't think my swift-ci permissions have been added yet. Care to start the tests when you have a second?

@jckarter
Copy link
Contributor

@swift-ci Please test

@drodriguez drodriguez merged commit 3f76e63 into swiftlang:master Feb 27, 2019
@drodriguez drodriguez deleted the reflection-context-fix-2 branch July 16, 2019 23:34
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