-
Notifications
You must be signed in to change notification settings - Fork 18
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
Accessor boundary check #178
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this will make life a lot easier! I've added some (mostly minor) notes; I think my biggest concern would be that the current implementation only checks against the backing buffer size, not what the user declared they plan on accessing (so whether or not the OOB check gets triggered could be dependent on scheduling decisions).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a huge fan of this PR. Only some minor comments on top of what psalz mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
This adds a new CMake option and preprocessor macro `CELERITY_ACCESSOR_BOUNDARY_CHECK` to enable out-of-bounds checking inside accessors. The option is enabled by default in debug builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
This PR depends on #173
This check has proven quite useful when debugging, hence adding only for debug builds since it can also have a non negligible impact on performance, after all it happens for all accessor subscriptor operators.
Not sure if just reporting it as a
CELERITY_ERROR
is enough or if it would also be expected for it to exit and report it as a fatal error or similar.