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

rustc: Fix x86 ffi for struct arguments #12762

Merged
merged 2 commits into from
Mar 19, 2014
Merged

Conversation

klutzy
Copy link
Contributor

@klutzy klutzy commented Mar 8, 2014

This fixes struct passing abi on x86 ffi: Structs are now passed
indirectly with byval attribute (as clang does).
Empty structs are also explicitly ignored rather than directly passed.

Fixes #5744
Fixes #11198
Fixes #11343

@alexcrichton
Copy link
Member

It looks like the only tests for this PR are the ones that are un-commented for #5744. Are there tests as well for #11198 and #11343? (just want to make sure)

@alexcrichton
Copy link
Member

If this is two distinct bug fixes (by-val and empty structs), it would be nice to have two separate commits for each.

@klutzy
Copy link
Contributor Author

klutzy commented Mar 9, 2014

Separated two fixes. Also added run-pass/extern-pass-empty which checks struct-inside-struct (#11343) and empty structs.
I think run-pass/extern-pass-TwoU8s covers #11198 (though minimal case is four u8s).

This fixes struct passing abi on x86 ffi: Structs are now passed
indirectly with byval attribute (as clang does).
@klutzy
Copy link
Contributor Author

klutzy commented Mar 19, 2014

Removed unrelated change (discussion here) and it passed make check-fast on win32.
(Note that #12707's modified test case will cause llvm assertion error on x86 as well)

bors added a commit that referenced this pull request Mar 19, 2014
This fixes struct passing abi on x86 ffi: Structs are now passed
indirectly with byval attribute (as clang does).
Empty structs are also explicitly ignored rather than directly passed.

Fixes #5744
Fixes #11198
Fixes #11343
@bors bors closed this Mar 19, 2014
@bors bors merged commit 2d31bca into rust-lang:master Mar 19, 2014
@klutzy klutzy deleted the win-struct-abi branch May 15, 2014 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants