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

Correct windows return by pointer calculation #6475

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

bhansconnect
Copy link
Contributor

@bhansconnect bhansconnect commented Jan 31, 2024

I always thought this was wrong. Saw it again today and decided to look it up. Windows will return by pointer for anything over 64bits on an x86_64 machine.

Note: this is wrong for windows aarch64, but I will correct that in a PR where I clean up targets.
https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170#return-values
https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#return-values

@lukewilliamboswell I'm not sure the state of windows tests, but do you have anything you can do to double check this/test locally on windows?

I always thought this was wrong. Saw it again today and decided to look it up.
Windows will return by pointer for anything over 64bits on an x86_64 machine.

Note: this is wrong for windows aarch64, but I will correct that in a PR where I clean up targets.
https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170#return-values
https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#return-values
@folkertdev
Copy link
Contributor

what I remember is that we played around with this earlier and it didn't seem to have an effect. So we left it as it was at the time. Still good to verify though with this change.

Copy link
Collaborator

@lukewilliamboswell lukewilliamboswell left a comment

Choose a reason for hiding this comment

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

I don't think there have been any regression for Windows.

All of the LLVM tests still pass, and I can run app using zig platforms with the legacy linker.

@bhansconnect bhansconnect merged commit 82ddfbb into main Jan 31, 2024
17 checks passed
@bhansconnect bhansconnect deleted the windows-cc-return-correction branch January 31, 2024 20:30
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