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: prototype number of parameters does not match definition #580

Closed
ehaas opened this issue Nov 25, 2023 · 0 comments
Closed

Crash: prototype number of parameters does not match definition #580

ehaas opened this issue Nov 25, 2023 · 0 comments
Labels
bug Something isn't working crash A bug that causes the compiler to crash

Comments

@ehaas
Copy link
Collaborator

ehaas commented Nov 25, 2023

int foo(int);

int foo(void) {
    return 0;
}
panic: for loop over objects with non-equal lengths
/Users/ehaas/source/arocc/src/aro/Type.zig:120:25: 0x108d9319e in eql (arocc)
        for (a.params, b.params) |param, b_qual| {
                        ^
/Users/ehaas/source/arocc/src/aro/Type.zig:1240:32: 0x108d22f59 in eql (arocc)
        => if (!a.data.func.eql(b.data.func, a.specifier, b.specifier, comp)) return false,
                               ^
/Users/ehaas/source/arocc/src/aro/SymbolStack.zig:220:28: 0x108e01b94 in defineSymbol (arocc)
                if (!ty.eql(prev.ty, p.comp, true)) {
                           ^
/Users/ehaas/source/arocc/src/aro/Parser.zig:997:32: 0x108d95c69 in decl (arocc)
        try p.syms.defineSymbol(p, interned_declarator_name, init_d.d.ty, init_d.d.name, node, .{}, false);
                               ^

To be fair, the loop is marked with // TODO validate this :)

@ehaas ehaas added bug Something isn't working crash A bug that causes the compiler to crash labels Nov 25, 2023
@Vexu Vexu closed this as completed in 4306589 Nov 27, 2023
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

No branches or pull requests

1 participant