Skip to content

@Frame crash the compiler when type error #6135

@codehz

Description

@codehz

The minimal poc

const std = @import("std");

pub fn main() anyerror!void {
    var pmap = std.AutoHashMap(u32, @Frame(main)).init(std.heap.page_allocator); // MAGIC
    _ = try pmap.getOrPut(0); // MAGIC
    random_error = it_is_impossible;
}

I'm not sure if it is related to std.hash_map...

And it is actually happens for another function insteads of main function (yes, i know it is useless to capture main function's frame), but I choose this as minimal example

error:

Assertion failed at /deps/zig/src/analyze.cpp:524 in get_pointer_to_type_extra2. This is a bug in the Zig compiler.
Unable to dump stack trace: debug info stripped

zig version: 0.6.0+dad7af0b3

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