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

@setEvalBranchQuota ineffectual in simple case #1257

Closed
andrewrk opened this issue Jul 18, 2018 · 0 comments
Closed

@setEvalBranchQuota ineffectual in simple case #1257

andrewrk opened this issue Jul 18, 2018 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior
Milestone

Comments

@andrewrk
Copy link
Member

test "aoeu" {
    @setEvalBranchQuota(1001);
    bar(1001);
}

fn bar(comptime n: usize) void {
    comptime var i = 0;
    inline while (i < n) : (i += 1) {}
}
/home/andy/downloads/zig/build/test.zig:8:12: error: evaluation exceeded 1000 backwards branches
    inline while (i < n) : (i += 1) {}
           ^
/home/andy/downloads/zig/build/test.zig:3:8: note: called from here
    bar(1001);
       ^

It's important that this works, because bar could be a third party API, for example std.fmt.format.

@andrewrk andrewrk added the bug Observed behavior contradicts documented or intended behavior label Jul 18, 2018
@andrewrk andrewrk added this to the 0.3.0 milestone Jul 18, 2018
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

1 participant