Skip to content

Broken LLVM module found: Call parameter type does not match function signature #8808

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

Closed
dmgk opened this issue May 17, 2021 · 1 comment
Closed
Milestone

Comments

@dmgk
Copy link

dmgk commented May 17, 2021

Minimal reproducer (0.8.0-dev.2275+8467373bb):

const std = @import("std");

fn func(args: [][*:0]const u8) void {}

pub fn main() void {
    var args = [_][*:0]const u8{ "one", "two" };

    // OK
    func(&args);

    // ICE
    {
        // broken LLVM module found: Call parameter type does not match function signature!
        // %"[][*:0]u8"* @argv
        // %"[][*:0]const u8"*  call fastcc void @func(%"[][*:0]u8"* @argv), !dbg !16063

        // This is a bug in the Zig compiler.thread 69656 panic:
        // Unable to dump stack trace: debug info stripped

        func(std.os.argv);
    }
}
@ehaas
Copy link
Contributor

ehaas commented May 18, 2021

I think this is a dupe of #7807

There is a workaround listed there: const argv: [][*:0]const u8 = std.os.argv; and then call func(argv)

@Vexu Vexu closed this as completed May 18, 2021
@andrewrk andrewrk added this to the 0.8.0 milestone Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants