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

Self-referential function calls segfault #1772

Closed
benjif opened this issue Nov 22, 2018 · 2 comments
Closed

Self-referential function calls segfault #1772

benjif opened this issue Nov 22, 2018 · 2 comments

Comments

@benjif
Copy link

benjif commented Nov 22, 2018

Is this compiler error worthy?

fn foo() void {
    foo();
}

Edit: It also happens for any multi-function loops. It doesn't occur when using zig build-exe test.zig --release-fast, but happens when running zig run test.zig

fn foo() void {
    bar();
}
fn bar() void {
    foo();
}
@andrewrk
Copy link
Member

This is a stack overflow. It's planned for zig to detect this at compile time, although it requires a lot of research to accomplish. See #1006 and #157

@benjif
Copy link
Author

benjif commented Nov 23, 2018

whoops, sorry and thanks for the response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants