Skip to content

slice of allowzero pointer is rejected in for #4361

@LemonBoy

Description

@LemonBoy

Reduced from clashos, this may be a regression ¯\_(ツ)_/¯

export fn _start() void {
    var a = [4]u32{ 1, 2, 3, 4 };
    var b = @ptrCast([*]allowzero u32, &a);

    for (b[0..4]) |ch| {
        if (ch > 4) @panic("");
    }
}
const builtin = @import("builtin");
pub fn panic(msg: []const u8, error_return_trace: ?*builtin.StackTrace) noreturn {
    while (true) {}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugObserved behavior contradicts documented or intended behaviorstage1The process of building from source via WebAssembly and the C backend.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions