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 taking slice of zero-length array #788

Closed
lanior opened this Issue Feb 24, 2018 · 0 comments

Comments

Projects
None yet
3 participants
@lanior

lanior commented Feb 24, 2018

Test cases:
pub fn main() void { ([]u32{})[0..]; }
pub fn main() void { ""[0..]; }

Compiler version: 0.1.1.8db7a142
Compiler output:

zig/src/analyze.cpp:394: TypeTableEntry* get_pointer_to_type_extra(CodeGen*, TypeTableEntry*, bool, bool, uint32_t, uint32_t, uint32_t): Assertion `byte_alignment > 0' failed.

@lanior lanior changed the title from Compiler crash when taking slice of zero-length string to Compiler crash when taking slice of zero-length array Feb 24, 2018

@tiehuis tiehuis added the bug label Feb 24, 2018

@andrewrk andrewrk added this to the 0.2.0 milestone Feb 25, 2018

@andrewrk andrewrk closed this in 44ae891 Mar 6, 2018

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