-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#: Deprecate AbstractValue. #20737
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
C#: Deprecate AbstractValue. #20737
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 deprecates the C#-specific AbstractValue class in favor of the shared GuardValue implementation from the Guards library. The changes systematically replace all references to AbstractValue with GuardValue and update method calls to use the new API (e.g., isNull() → isNullValue(), getValue() → asBooleanValue()).
Key changes:
- Renamed
AbstractValuetoGuardValuethroughout the codebase - Updated method calls to use the new
GuardValueAPI - Deprecated the
AbstractValueclass andAbstractValuesmodule while maintaining backward compatibility
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Guards.qll | Deprecated AbstractValue and AbstractValues module; updated all internal references to use GuardValue |
| DataFlowPublic.qll | Updated signature and usages to use GuardValue instead of AbstractValue |
| SsaImpl.qll | Updated guard signature and internal predicate to use GuardValue |
| RangeUtils.qll | Removed BooleanValue type alias and updated to use GuardValue directly |
| Nullness.qll | Removed AbstractValues import and updated null checks to use GuardValue |
| TaintedPathQuery.qll | Updated predicates to use GuardValue and new API methods |
| UrlRedirectQuery.qll | Updated guard predicates to use GuardValue and asBooleanValue() |
| ZipSlipQuery.qll | Updated guard predicate signature and method calls |
| RequestForgery.qll | Updated guard predicates to use GuardValue and asBooleanValue() |
| Test files (5 files) | Updated query signatures and predicates to use GuardValue |
| change-notes | Added deprecation notice for AbstractValue |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
3a33dbf to
4f6528a
Compare
|
|
||
| private import AbstractValues | ||
|
|
||
| // private import AbstractValues |
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.
Remove
| * If the returned expression evaluates to `null` (`v.isNull()`) or evaluates to | ||
| * non-`null` (`not v.isNull()`), then this expression is guaranteed to be `null` | ||
| * If the returned expression evaluates to `null` (`v.isNullValue()`) or evaluates to | ||
| * non-`null` (`not v.isNullValue()`), then this expression is guaranteed to be `null` |
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.
not v.isNullValue() -> v.isNonNullValue()?
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.
Right! Although now that I look at it, this predicate only has a single simple use, so might as well inline the parts that are used and get rid of the rest.
Now that the Guards library has been updated to use the shared implementation, we can deprecate the C#-specific AbstractValue.