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

Fix mismatched tuple ABIs in Rust #1113

Merged
merged 5 commits into from
Jan 7, 2025

Conversation

alexcrichton
Copy link
Member

This fixes the mistaken assumption that the tuple ABI in Rust is the same as the component model ABI and generates different code for lifting/lowering lists.

Closes #1112

This fixes the mistaken assumption that the tuple ABI in Rust is the
same as the component model ABI and generates different code for
lifting/lowering lists.

Closes bytecodealliance#1112
@sunfishcode
Copy link
Member

Is the issue here that the Rust tuple types are not repr(C), so they're using the Rust struct layout, which is probably packing the two s8s together?

@alexcrichton
Copy link
Member Author

Right yeah, and it mistakenly fell through the cracks in the check for "can we just use the raw list pointer as-is" so this PR fixes that by updating that check to explicitly go through manual lift/lower steps for lists-of-tuples

@alexcrichton alexcrichton added this pull request to the merge queue Jan 7, 2025
Merged via the queue into bytecodealliance:main with commit 19f259b Jan 7, 2025
25 checks passed
@alexcrichton alexcrichton deleted the fix-rust-tuple-abi branch January 7, 2025 19:40
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.

Rust: corrupted function argument of type list<tuple<s8, s64, s8>>
2 participants