File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
src/utils/model-generator/internal
test/utils/model-generator Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -18,13 +18,16 @@ module TaintTracking = CS::TaintTracking;
1818class Type = CS:: Type ;
1919
2020/**
21- * Holds if `api` is an override of `GetHashCode` or `Equals`.
21+ * Holds if `api` is an override or an interface implementation that
22+ * is irrelevant to the data flow analysis.
2223 */
23- private predicate isIrrellevantObjectOveride ( CS:: Callable api ) {
24+ private predicate isIrrelevantOverrideOrImplementation ( CS:: Callable api ) {
2425 exists ( System:: SystemObjectClass c |
2526 api = c .getGetHashCodeMethod ( ) .getAnOverrider * ( ) or
2627 api = c .getEqualsMethod ( ) .getAnOverrider * ( )
2728 )
29+ or
30+ exists ( System:: IEquatableEqualsMethod equals | equals = api )
2831}
2932
3033/**
@@ -35,7 +38,7 @@ private predicate isRelevantForModels(CS::Callable api) {
3538 api .getDeclaringType ( ) .getNamespace ( ) .getQualifiedName ( ) != "" and
3639 not api instanceof CS:: ConversionOperator and
3740 not api instanceof Util:: MainMethod and
38- not isIrrellevantObjectOveride ( api )
41+ not isIrrelevantOverrideOrImplementation ( api )
3942}
4043
4144/**
Original file line number Diff line number Diff line change @@ -42,4 +42,22 @@ public int ReturnParam(int input)
4242 }
4343 }
4444 }
45+ }
46+
47+ public class EquatableBound : IEquatable < int >
48+ {
49+ public readonly bool tainted ;
50+ public bool Equals ( int other )
51+ {
52+ return tainted ;
53+ }
54+ }
55+
56+ public class EquatableUnBound < T > : IEquatable < T >
57+ {
58+ public readonly bool tainted ;
59+ public bool Equals ( T ? other )
60+ {
61+ return tainted ;
62+ }
4563}
You can’t perform that action at this time.
0 commit comments