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

Comments

Projects
None yet
1 participant
@andrewrk
Member

andrewrk commented Jul 18, 2018

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 label Jul 18, 2018

@andrewrk andrewrk added this to the 0.3.0 milestone Jul 18, 2018

@andrewrk andrewrk closed this in cbfe9a4 Jul 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment