Vexu / arocc

A C compiler written in Zig.

Home Page:http://aro.vexu.eu/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash: enumeration constant with same name as existing identifier + non-`int` type

ehaas opened this issue · comments

int X = 0;
enum E {
    X = 4294967295
};
panic: reached unreachable code
/Users/ehaas/local/zig-macos-x86_64-0.12.0-dev.2619+5cf138e51/lib/std/debug.zig:403:14: 0x1074ff9bc in assert (arocc)
    if (!ok) unreachable; // assertion failure
             ^
/Users/ehaas/source/arocc/src/aro/Value.zig:35:21: 0x1075b46b9 in ref (arocc)
    std.debug.assert(v.opt_ref != .none);
                    ^
/Users/ehaas/source/arocc/src/aro/Value.zig:668:46: 0x10771c590 in compare (arocc)
    const lhs_key = comp.interner.get(lhs.ref());
                                             ^
/Users/ehaas/source/arocc/src/aro/Parser.zig:5917:31: 0x1077ffbe9 in intFitsInType (arocc)
        return res.val.compare(.lte, max_int, p.comp) and
                              ^
/Users/ehaas/source/arocc/src/aro/Parser.zig:2574:43: 0x1077af7d4 in enumSpec (arocc)
            else if (try res.intFitsInType(p, Type.int))
                                          ^
/Users/ehaas/source/arocc/src/aro/Parser.zig:2020:47: 0x107725b4a in typeSpec (arocc)
                const enum_ty = try p.enumSpec();