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

Infinite recursion doesn't produce specific error #10745

Closed
jecolon opened this issue Jan 31, 2022 · 2 comments
Closed

Infinite recursion doesn't produce specific error #10745

jecolon opened this issue Jan 31, 2022 · 2 comments
Labels
bug Observed behavior contradicts documented or intended behavior

Comments

@jecolon
Copy link

jecolon commented Jan 31, 2022

Zig Version

0.10.0-dev.40+303bad998

Steps to Reproduce

fn infinity() void {
    infinity();
}

pub fn main() void {
    infinity();
}

Expected Behavior

When run with zig build run, maybe a stack overflow error would be a helpful hint that this is an infinite recursion bug.

Actual Behavior

When running this main.zig with zig build run it only produces a The following command terminated unexpectedly: error with no specific indication or hint as to what went wrong. In a large code base, it can be really hard to find the bug.

@jecolon jecolon added the bug Observed behavior contradicts documented or intended behavior label Jan 31, 2022
@ominitay
Copy link
Contributor

duplicate of #1616

@jecolon
Copy link
Author

jecolon commented Jan 31, 2022

@ominitay ; thanks for the heads up. Closing it.

@jecolon jecolon closed this as completed Jan 31, 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