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

Fix StackOverflowError when a wire is connected to itself #41

Merged
merged 1 commit into from
Dec 9, 2022

Commits on Dec 8, 2022

  1. Fix StackOverflowError when a wire is connected to itself

    During each tick, electrical components are checked for whether they
    connect to ground with the help of the method
    `Terminal.connectsToGround()`. The method contains a `maxSteps`
    parameter that is decremented on each recursive call to prevent infinite
    recursion. However, the value of `maxSteps` was never checked, so the
    method would recurse infinitely until the stack overflowed when one
    terminal of a wire was connected to the other terminal. Adding checks to
    stop recursing when `maxSteps` reaches 0 prevents the error.
    aphedges committed Dec 8, 2022
    Configuration menu
    Copy the full SHA
    3bff6a8 View commit details
    Browse the repository at this point in the history