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

Crash: generic expression value is call to non-existent function #659

Closed
ehaas opened this issue Apr 1, 2024 · 0 comments · Fixed by #664
Closed

Crash: generic expression value is call to non-existent function #659

ehaas opened this issue Apr 1, 2024 · 0 comments · Fixed by #664
Labels
bug Something isn't working crash A bug that causes the compiler to crash

Comments

@ehaas
Copy link
Collaborator

ehaas commented Apr 1, 2024

void foo(void) {
    _Generic(0, int: 8, long: bar(3))
}
panic: for loop over objects with non-equal lengths
/Users/ehaas/source/arocc/src/aro/Parser.zig:8609:73: 0x10a6233ee in genericSelection (arocc)
            for (p.list_buf.items[list_buf_top + 1 ..], p.decl_buf.items[decl_buf_top..]) |item, prev_tok| {
                                                                        ^
/Users/ehaas/source/arocc/src/aro/Parser.zig:7946:54: 0x10a613a88 in primaryExpr (arocc)
        .keyword_generic => return p.genericSelection(),
                                                     ^
/Users/ehaas/source/arocc/src/aro/Parser.zig:7278:40: 0x10a60a6ce in unExpr (arocc)
                lhs = try p.primaryExpr();
                                       ^
/Users/ehaas/source/arocc/src/aro/Parser.zig:6716:20: 0x10a5fd5b8 in castExpr (arocc)
    return p.unExpr();
                   ^
@ehaas ehaas added bug Something isn't working crash A bug that causes the compiler to crash labels Apr 1, 2024
ehaas added a commit to ehaas/arocc that referenced this issue Apr 3, 2024
ensure list_buf and decl_buf have the same length before iterating over
them to check for duplicate controlling expressions

Fixes Vexu#659
ehaas added a commit to ehaas/arocc that referenced this issue Apr 3, 2024
ensure list_buf and decl_buf have the same length before iterating over
them to check for duplicate controlling expressions

Fixes Vexu#659
@Vexu Vexu closed this as completed in #664 Apr 3, 2024
Vexu pushed a commit that referenced this issue Apr 3, 2024
ensure list_buf and decl_buf have the same length before iterating over
them to check for duplicate controlling expressions

Fixes #659
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working crash A bug that causes the compiler to crash
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant