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

Passing []void argument constructed from address of [N]void causes compiler to exit #6951

Closed
SpexGuy opened this issue Nov 2, 2020 · 0 comments · Fixed by #7233
Closed
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@SpexGuy
Copy link
Contributor

SpexGuy commented Nov 2, 2020

// repro.zig
pub fn destroy(old_mem: []void) void { }

test "" {
    var array: [4]void = undefined;
    _ = destroy(&array);
}
> zig version
0.6.0+0088efc4b
> zig test repro.zig
>

No tests are run, the compiler just dies silently.

@SpexGuy SpexGuy added bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend. labels Nov 3, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 3, 2020
LemonBoy added a commit to LemonBoy/zig that referenced this issue Nov 26, 2020
Prevent the crash by not making the codegen try to access the
non-existing ptr field in the slice.

Closes ziglang#6951
andrewrk pushed a commit that referenced this issue Nov 27, 2020
Prevent the crash by not making the codegen try to access the
non-existing ptr field in the slice.

Closes #6951
@andrewrk andrewrk modified the milestones: 0.9.0, 0.7.1 Nov 27, 2020
andrewrk pushed a commit that referenced this issue Nov 27, 2020
Prevent the crash by not making the codegen try to access the
non-existing ptr field in the slice.

Closes #6951
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

Successfully merging a pull request may close this issue.

2 participants