Skip to content

stage1: Fix undefined assignment for bitfields #7081

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

Merged
merged 1 commit into from
Nov 19, 2020

Conversation

LemonBoy
Copy link
Contributor

Prevents silent memory corruption.

Closes #7055

Prevents silent memory corruption.

Closes ziglang#7055
// This is a pointer into a packed struct, we can't use memset here.
// The jury is still out on what pattern should be written here so clear the
// old value and call it a day. Generating a 0xAA...AA mask for this n-bit
// value is left as an exercise for the (bored) reader.
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you include the string TODO: so that it can be grepped for later? Possibly referencing an open zig issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not really, the original bug was brushed off as something not meant to be fixed in stage1.
The fix is barely enough to avoid some gratuitous memory corruption.

@andrewrk andrewrk merged commit 2b7781d into ziglang:master Nov 19, 2020
@andrewrk
Copy link
Member

cherry-picked into 0.7.x => c6c25a1

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.

Assignment from struct literal to variable not working
3 participants