-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Guards: Improve support for wrapped guards #20121
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
base: main
Are you sure you want to change the base?
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.
Pull Request Overview
This PR improves the shared library implementation of guard wrappers by generalizing the wrapper support and simplifying the interface. The changes extend wrapper functionality to handle all return value types (not just booleans), support both normal and exceptional returns, and prepare for wrapped sanitizer support.
- Removes the nested parameterization of
CustomGuard
/WrapperGuard
modules to simplify the interface - Generalizes wrapper support to handle all return value types and exceptional/normal returns
- Adds infrastructure for wrapped sanitizers through new
ValidationWrapper
modules
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
shared/controlflow/codeql/controlflow/Guards.qll | Core implementation with generalized wrapper support, new validation wrapper modules, and simplified interface |
java/ql/lib/semmle/code/java/controlflow/Guards.qll | Java-specific implementation updates to use new wrapper interface and remove old CustomGuard module |
java/ql/test/library-tests/guards/Guards.java | Test cases for new wrapper functionality including non-boolean returns and exception handling |
java/ql/test/library-tests/guards/GuardsInline.expected | Expected test output for new wrapper test cases |
940bd35
to
f0be0ae
Compare
0f20906
to
8d747e9
Compare
Dca looks good. A bunch of FPs for |
This improves the shared library implementation of guard wrappers in several ways. Commit-by-commit review is strongly encouraged.
CustomGuard
/WrapperGuard
module.BarrierGuard
to support wrapped sanitizers.