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

non-byte-aligned packed struct field passed as generic fn parameter causes invalid LLVM IR #3460

Closed
andrewrk opened this issue Oct 15, 2019 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@andrewrk
Copy link
Member

const P = packed struct {
    b: u5,
    g: u5,
    r: u5,
    a: u1,
};

fn genericFn(ptr: var) void {}

test "" {
    var p: P = undefined;
    genericFn(&p.b);
}
broken LLVM module found: Call parameter type does not match function signature!
  %12 = getelementptr inbounds %P, %P* %p, i32 0, i32 0, !dbg !1162
 i16*  call fastcc void @genericFn([2 x i8]* %12), !dbg !1163
@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend. labels Oct 15, 2019
@andrewrk andrewrk added this to the 0.6.0 milestone Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Projects
None yet
Development

No branches or pull requests

1 participant