Skip to content

Compiler crash: runtime break :blk out of inline loop inside labelled block #8942

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
ghost opened this issue May 30, 2021 · 1 comment
Closed
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@ghost
Copy link

ghost commented May 30, 2021

All I see is "Segmentation fault: 11". Both zig 0.7.1 and latest master.

I'm guessing this should be a compiler error as I don't think you're normally allowed to do runtime break/continue out of inline loops?

pub fn main() void {
    blk: {
        inline for ("hello") |_| {
            var x = true;
            if (x) break :blk;
        }
    }
}

Related to or at least sort of similar to #4484

Edit: linking #2727 as well

@Vexu Vexu added stage1 The process of building from source via WebAssembly and the C backend. bug Observed behavior contradicts documented or intended behavior labels May 31, 2021
@Vexu Vexu added this to the 0.10.0 milestone May 31, 2021
@ghost
Copy link
Author

ghost commented May 31, 2021

Actually this is the same as #2908 which was closed as a dupe of #2727, so I'll close this one too.

@ghost ghost closed this as completed May 31, 2021
@Vexu Vexu modified the milestones: 0.10.0, 0.8.0 Jun 4, 2021
This issue was closed.
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

1 participant