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 &slice[0] as argument causes compiler assert when payload is zero sized #6947

Closed
SpexGuy opened this issue Nov 2, 2020 · 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

@SpexGuy
Copy link
Contributor

SpexGuy commented Nov 2, 2020

// repro.zig
pub fn destroy(ptr: *void) void {}

test "" {
    var slice: []void = undefined;
    destroy(&slice[0]);
}
> zig version
0.6.0+0088efc4b
> zig test repro.zig
Assertion failed at D:\a\1\s\src\stage1\codegen.cpp:3933 in ir_render_elem_ptr. This is a bug in the Zig compiler.
Unable to dump stack trace: debug info stripped
@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
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
wooster0 added a commit to wooster0/zig that referenced this issue Dec 7, 2022
wooster0 added a commit to wooster0/zig that referenced this issue Dec 7, 2022
wooster0 added a commit to wooster0/zig that referenced this issue Dec 7, 2022
wooster0 added a commit to wooster0/zig that referenced this issue Dec 7, 2022
wooster0 added a commit to wooster0/zig that referenced this issue Dec 8, 2022
wooster0 added a commit to wooster0/zig that referenced this issue Dec 9, 2022
@andrewrk andrewrk modified the milestones: 0.12.0, 0.11.0 Dec 10, 2022
kcbanner pushed a commit to kcbanner/zig that referenced this issue Dec 10, 2022
TUSF pushed a commit to TUSF/zig that referenced this issue May 9, 2024
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

2 participants