Skip to content

Compiler segfault with orelse in anonymous struct literal #11205

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
git-bruh opened this issue Mar 17, 2022 · 1 comment
Closed

Compiler segfault with orelse in anonymous struct literal #11205

git-bruh opened this issue Mar 17, 2022 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@git-bruh
Copy link
Contributor

git-bruh commented Mar 17, 2022

Zig Version

0.9.1

Steps to Reproduce

pub fn main() !void {
    var a: ?i32 = null;
    var b: ?i32 = 1;

    const s = .{a orelse b};
    _ = s;
}

Expected Behavior

A successful build

Actual Behavior

broken LLVM module found: Instruction does not dominate all uses!
  %6 = getelementptr inbounds %"struct:5:16", %"struct:5:16"* %s, i32 0, i32 0, !dbg !17154
  %11 = getelementptr inbounds %"?i32", %"?i32"* %6, i32 0, i32 1, !dbg !17153
Instruction does not dominate all uses!
  %6 = getelementptr inbounds %"struct:5:16", %"struct:5:16"* %s, i32 0, i32 0, !dbg !17154
  %12 = getelementptr inbounds %"?i32", %"?i32"* %6, i32 0, i32 0, !dbg !17153

This is a bug in the Zig compiler.thread 17670 panic:
Unable to dump stack trace: debug info stripped
Aborted
@git-bruh git-bruh added the bug Observed behavior contradicts documented or intended behavior label Mar 17, 2022
@Vexu Vexu added the stage1 The process of building from source via WebAssembly and the C backend. label Mar 17, 2022
@Vexu Vexu added this to the 0.11.0 milestone Mar 17, 2022
@Vexu
Copy link
Member

Vexu commented Jan 13, 2023

Duplicate of #3882

@Vexu Vexu marked this as a duplicate of #3882 Jan 13, 2023
@Vexu Vexu closed this as completed Jan 13, 2023
@andrewrk andrewrk modified the milestones: 0.12.0, 0.11.0 Jan 14, 2023
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

3 participants