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

Recursive function calls remain unchecked #38

Open
Feliix42 opened this issue May 15, 2019 · 0 comments
Open

Recursive function calls remain unchecked #38

Feliix42 opened this issue May 15, 2019 · 0 comments

Comments

@Feliix42
Copy link
Member

The following algorithm contains the obvious error that the recursive function call has too few arguments, yet the compiler does not report this error, provoking the generation of incorrect code in the backend that does not compile for no apparent reason.

fn transact(maze: Maze, to_map: Vec<(Point, Point)>, frequency: usize, stats: (u32, u32)) -> (Maze, (u32, u32)) {
    /* ... */

    if (is_not_empty(to_remap)) {
        transact(new_maze, to_remap, ct)
    } else {
        ret
    }
}

To improve this I suggest a check of arguments for recursive function calls.

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

1 participant