Skip to content
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

uintptr test: Fix overflow on architectures with 32-bit pointers #100

Merged
merged 1 commit into from Jul 9, 2021

Conversation

prashantv
Copy link
Collaborator

Fixes #99

The current uintptr test assumes that pointers are 64-bit, so the test
fails to compile on architectures with 32-bit pointers. Instead, cast
-1 to uintptr, which matches math.MaxUint64 on 64-bit architectures, and
math.MaxUint32 on 32-bit architectures.

Verified by using GOARCH=386

Fixes #99

The current uintptr test assumes that pointers are 64-bit, so the test
fails to compile on architectures with 32-bit pointers. Instead, cast
-1 to uintptr, which matches math.MaxUint64 on 64-bit architectures, and
math.MaxUint32 on 32-bit architectures.

Verified by using GOARCH=386
@prashantv prashantv requested a review from abhinav July 9, 2021 00:44
@codecov
Copy link

codecov bot commented Jul 9, 2021

Codecov Report

Merging #100 (0f53d08) into master (557b938) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #100   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           18        18           
  Lines          181       181           
=========================================
  Hits           181       181           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 557b938...0f53d08. Read the comment docs.

Copy link

@rabbbit rabbbit left a comment

Choose a reason for hiding this comment

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

Bit of magic, but sure.

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.

uintptr test fails on armhf
3 participants