Skip to content

Conversation

@aschackmull
Copy link
Contributor

Now that the Guards library has been updated to use the shared implementation, we can deprecate the C#-specific AbstractValue.

@aschackmull aschackmull requested a review from a team as a code owner October 31, 2025 13:15
Copilot AI review requested due to automatic review settings October 31, 2025 13:15
Copy link
Contributor

Copilot AI left a 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 AbstractValue to GuardValue throughout the codebase
  • Updated method calls to use the new GuardValue API
  • Deprecated the AbstractValue class and AbstractValues module 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.

@aschackmull aschackmull force-pushed the csharp/deprecate-abstractvalue branch from 3a33dbf to 4f6528a Compare October 31, 2025 13:23

private import AbstractValues

// private import AbstractValues
Copy link
Contributor

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`
Copy link
Contributor

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()?

Copy link
Contributor Author

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.

@aschackmull aschackmull merged commit bda6513 into github:main Oct 31, 2025
23 checks passed
@aschackmull aschackmull deleted the csharp/deprecate-abstractvalue branch October 31, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants