-
-
Notifications
You must be signed in to change notification settings - Fork 183
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
Union is not properly zero-initialized #1194
Labels
Comments
Ooooh, interesting! |
I can't reproduce this and the LLVM output looks fine, is there some variant of this that you used? |
Ah right, my example was actually working. This is what I tested with: union Rect {
struct { float[<2>] min, max; }
}
fn void test_rect(float[<2>] max) {
Rect rect = {.max = max};
assert(rect.min == {});
}
fn void main() {
test_rect({1,2});
} My full union looks like this by the way. I don't think it's required to reproduce the issue, but you can check codegen for this too. union Rect {
struct { float min_x, min_y, max_x, max_y; }
struct { float left, top, right, bottom; }
struct { Vec2f min, max; }
Vec4f v;
Vec2f[2] p;
} |
lerno
added a commit
that referenced
this issue
May 16, 2024
lerno
added
the
Fixed Needs Verification
Fixed, but needs verification that it works
label
May 16, 2024
Should work fine now. |
This fixed it for me, thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
The text was updated successfully, but these errors were encountered: