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

Comments

Projects
None yet
2 participants
@tiehuis
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 label Jan 22, 2018

@andrewrk andrewrk added this to the 0.2.0 milestone Jan 22, 2018

@andrewrk

This comment has been minimized.

Member

andrewrk commented Jan 22, 2018

Workaround: add a 2nd field to the union.

@andrewrk andrewrk closed this in cacba6f Jan 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment