Skip to content

fix(Sema): fix 0-bit fields inside extern or packed structs #23341

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

Closed

Conversation

GasInfinity
Copy link
Contributor

This fixes extern and packed structs with 0-bit fields, for which stores in them weren't properly handled.

First time touching the compiler 🤞🏼
I'm all ears for nits and suggestions.
Resolves #23307

@alexrp alexrp requested a review from mlugg March 24, 2025 14:26
@alexrp
Copy link
Member

alexrp commented Mar 25, 2025

Would be nice to add a behavior test if possible.

@alexrp alexrp added this to the 0.14.1 milestone Mar 25, 2025
@mlugg
Copy link
Member

mlugg commented Apr 26, 2025

Pretty sure zero-bit stores aren't meant to actually reach this code, since they're valid on any pointer and are always nops so shouldn't go through the actual store machinery. I'll take a closer look shortly.

@Vexu
Copy link
Member

Vexu commented Apr 26, 2025

Pretty sure zero-bit stores aren't meant to actually reach this code,

Related #23640

@mlugg
Copy link
Member

mlugg commented Apr 27, 2025

Superseded by #23712.

@mlugg mlugg closed this Apr 27, 2025
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.

Division by zero in comptime_ptr_access of 0-bit field
4 participants