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 access specifiers between CBS.h/ECBS.h #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

justinokamoto
Copy link

@justinokamoto justinokamoto commented Sep 22, 2024

Calling terminate() on ECBS object caused a segfault because terminate() is implemented by the base class CBS. This method called printPaths() (from the base implementation) which caused the segfault since the member variable paths_found_initially from the base implementation was empty.

To make matters confusing, the base class had a protected variable paths_found_initially but the subclass "shadows" this variable by defining a private variable with the same
name (paths_found_initially) but a different type.

This change updates access specifiers to align with usage and prevent segfault when CBS::terminate() is called from a subclass.

Fixes #2

Calling `terminate()` on `ECBS` object caused a segfault because
`terminate()` is implemented by the base class `CBS`. This method
called `printPaths()` (from the base implementation) which caused the
segfault since the member variable `paths_found_initially` from the
base implementation was empty.

To make matters confusing, the base class had a protected variable
`paths_found_initially` but the subclass "shadows" this variable by
defining a private variable with the same
name (`paths_found_initially`) but a different type.

This change updates access specifiers to align with usage and prevent
segfault when `CBS::terminate()` is called from a subclass.
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

Successfully merging this pull request may close these issues.

Improper access specifiers causing segfault when terminate() is called on ECBS object
1 participant