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

stage1: Fix LLVM C ABI type resolution for small packed structs #10499

Merged
merged 2 commits into from Jan 4, 2022
Merged

stage1: Fix LLVM C ABI type resolution for small packed structs #10499

merged 2 commits into from Jan 4, 2022

Conversation

paulsnar
Copy link
Contributor

@paulsnar paulsnar commented Jan 3, 2022

See #10431 and #9443 for context. Thus far this has been tested really only on Zig master on Linux x86_64, so I'm kinda relying on CI to highlight any potential breakage on other platforms.

Regarding tests, packed structs weren't tested at all in stage1 C ABI until this point, so I added relevant tests for both small and big packed structs, but C→Zig calls still don't support packed struct arguments so small struct cases wouldn't compile with a link to #1481, so I left them commented out for now. If this isn't right, feel free to change or request changes as you see fit; this is my first time contributing and the first time I've dug through stage1 so I might be off base on this one.

For Github's sake: resolves #10431

Small packed structs weren't included in this resolution so their
c_abi_type would be NULL when attempting usage later, leading to a
compiler crash.

Resolves #10431.
@andrewrk andrewrk merged commit 5b0be0d into ziglang:master Jan 4, 2022
@andrewrk
Copy link
Member

andrewrk commented Jan 4, 2022

Thanks!

andrewrk added a commit that referenced this pull request Jan 12, 2022
…s-cabi

stage1: Fix LLVM C ABI type resolution for small packed structs
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.

Compiler segfault for callconv(.C) functions returning a small packed struct type
2 participants