Skip to content

C++: Fix polymorphic lookup and add tests #576

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

Merged
merged 5 commits into from
Mar 4, 2022
Merged

Conversation

mattklein123
Copy link
Contributor

The previous iteration does not make ASAN happy because of the implicit
static cast between Message and concrete type. This PR reverts that
change, adds a new abstract validation registry, and explicitly performs
a dynamic cast when asked to do so. It also checks to make sure a
validator exists for the passed in message.

Also add a .clang-format so at least manual formatting can be done.

Signed-off-by: Matt Klein [email protected]

The previous iteration does not make ASAN happy because of the implicit
static cast between Message and concrete type. This PR reverts that
change, adds a new abstract validation registry, and explicitly performs
a dynamic cast when asked to do so. It also checks to make sure a
validator exists for the passed in message.

Also add a .clang-format so at least manual formatting can be done.

Signed-off-by: Matt Klein <[email protected]>
Signed-off-by: Matt Klein <[email protected]>
Copy link
Contributor

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable, but not sure I follow how AbstractCheckMessage is to be used.

@mattklein123
Copy link
Contributor Author

@htuch updated per comments

Signed-off-by: Matt Klein <[email protected]>
Copy link
Contributor

@htuch htuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mattklein123 mattklein123 merged commit 4694024 into main Mar 4, 2022
@mattklein123 mattklein123 deleted the fix_polymorphic branch March 4, 2022 15:07
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.

3 participants