Skip to content

Commit 8726766

Browse files
committed
C#: Remove the API special case for GetHashCode, Equals and IEquatable.Equals as these are now excluded based on their type.
1 parent f6fd401 commit 8726766

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

csharp/ql/src/utils/model-generator/internal/CaptureModelsSpecific.qll

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,14 @@ module TaintTracking = CS::TaintTracking;
1717

1818
class Type = CS::Type;
1919

20-
/**
21-
* Holds if `api` is an override or an interface implementation that
22-
* is irrelevant to the data flow analysis.
23-
*/
24-
private predicate isIrrelevantOverrideOrImplementation(CS::Callable api) {
25-
exists(CS::Callable exclude, CS::Method m |
26-
(
27-
api = m.getAnOverrider*().getUnboundDeclaration()
28-
or
29-
api = m.getAnUltimateImplementor().getUnboundDeclaration()
30-
) and
31-
exclude = m.getUnboundDeclaration()
32-
|
33-
exists(System::SystemObjectClass c | exclude = [c.getGetHashCodeMethod(), c.getEqualsMethod()])
34-
or
35-
exists(System::SystemIEquatableTInterface i | exclude = i.getEqualsMethod())
36-
)
37-
}
38-
3920
/**
4021
* Holds if it is relevant to generate models for `api`.
4122
*/
4223
private predicate isRelevantForModels(CS::Callable api) {
4324
[api.(CS::Modifiable), api.(CS::Accessor).getDeclaration()].isEffectivelyPublic() and
4425
api.getDeclaringType().getNamespace().getQualifiedName() != "" and
4526
not api instanceof CS::ConversionOperator and
46-
not api instanceof Util::MainMethod and
47-
not isIrrelevantOverrideOrImplementation(api)
27+
not api instanceof Util::MainMethod
4828
}
4929

5030
/**

0 commit comments

Comments
 (0)