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

False dependency loop with pointer to array of frames. #3777

Open
Vexu opened this issue Nov 26, 2019 · 1 comment
Open

False dependency loop with pointer to array of frames. #3777

Vexu opened this issue Nov 26, 2019 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@Vexu
Copy link
Member

Vexu commented Nov 26, 2019

Zig is unable to resolve frame size when the frame contains a pointer to an array of its own frames.

pub fn main() void {
    // works
    // var frame1: *@Frame(main) = undefined;
    // error: cannot resolve '@Frame(main)': function not fully analyzed yet
    var frame2: *[1]@Frame(main) = undefined;
}
@Vexu
Copy link
Member Author

Vexu commented Nov 26, 2019

This should also work:

pub fn main() void {
    const size = @sizeOf(@Frame(main));
    var ptr: *[size]u8 = undefined;
}

@andrewrk andrewrk added this to the 0.6.0 milestone Nov 27, 2019
@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend. labels Nov 27, 2019
@andrewrk andrewrk modified the milestones: 0.6.0, 0.7.0 Mar 4, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Aug 13, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
@Vexu Vexu removed the stage1 The process of building from source via WebAssembly and the C backend. label Dec 28, 2022
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
Projects
None yet
Development

No branches or pull requests

2 participants