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 on some combination of scope nesting with switch #656

Closed
andrewrk opened this Issue Dec 14, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@andrewrk
Member

andrewrk commented Dec 14, 2017

f55fdc0

pub const NodePrefixOp = struct {
    op: PrefixOp,

    const PrefixOp = union(enum) {
        Return,
        AddrOf: u32,
    };
};

export fn entry(a: bool) {
    if (a) {
    } else {
        var prefix_op_node: &NodePrefixOp = undefined;
        switch (prefix_op_node.op) {
            NodePrefixOp.PrefixOp.AddrOf => |addr_of_info| {
                if (true) { }
                if (addr_of_info.align_expr) |align_expr| {
                }
            },
        }
    }
}

pub fn panic(msg: []const u8) -> noreturn { while (true) {} }

zig build-obj test.zig

zig: /home/andy/dev/zig/src/ir.cpp:10606: IrInstruction* ir_get_var_ptr(IrAnalyze*, IrInstruction*, VariableTableEntry*, bool, bool): Assertion `var->value->type' failed.
Aborted (core dumped)

@andrewrk andrewrk added the bug label Dec 14, 2017

@andrewrk andrewrk added this to the 0.2.0 milestone Dec 14, 2017

@andrewrk andrewrk closed this in c9e0141 Dec 14, 2017

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