Skip to content

evented IO in noreturn function causes generation of broken LLVM module #5728

@ghost

Description

const std = @import("std");
pub const io_mode: std.io.Mode = .evented;

fn bleh() noreturn {
    std.io.getStdOut().writer().writeAll("x") catch {};
    unreachable;
}

pub fn main() !void {
    bleh();
}

produces the following output from the compiler:

broken LLVM module found: Basic Block in function 'main' does not have terminator!
label %OkResume

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behavior

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions