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

compiler crash when accessing definition in extern union with 0 size #2401

Closed
tgschultz opened this issue May 1, 2019 · 0 comments
Closed
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@tgschultz
Copy link
Contributor

tgschultz commented May 1, 2019

const std = @import("std");

test "0-sized extern union definition" {
    const U = extern union {
        a: void,
        const f = 1;
    };
    
    std.testing.expect(U.f == 1);
}

further testing reveals that the definition must be const to trigger the crash.

@andrewrk andrewrk added this to the 0.5.0 milestone May 2, 2019
@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label May 2, 2019
@andrewrk andrewrk modified the milestones: 0.5.0, 0.6.0 Sep 27, 2019
@andrewrk andrewrk added the stage1 The process of building from source via WebAssembly and the C backend. label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Projects
None yet
Development

No branches or pull requests

2 participants