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

getAlignmentInfo segfault on union(enum) #713

Closed
tiehuis opened this issue Jan 22, 2018 · 1 comment
Closed

getAlignmentInfo segfault on union(enum) #713

tiehuis opened this issue Jan 22, 2018 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@tiehuis
Copy link
Member

tiehuis commented Jan 22, 2018

Latest Zig master, using LLVM-5.0.1.

const PartialInst = union(enum) {
    Compiled,
};

test "a" {
    var r: PartialInst = undefined;
}

Backtrace

#0  0x00007ffff4bca568 in llvm::DataLayout::getAlignmentInfo(llvm::AlignTypeEnum, unsigned int, bool, llvm::Type*) const () from /usr/lib/libLLVM-5.0.so
#1  0x0000000000000000 in ?? ()
@tiehuis tiehuis added the bug Observed behavior contradicts documented or intended behavior label Jan 22, 2018
@andrewrk andrewrk added this to the 0.2.0 milestone Jan 22, 2018
@andrewrk
Copy link
Member

Workaround: add a 2nd field to the union.

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
Projects
None yet
Development

No branches or pull requests

2 participants