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;
18
18
class Type = CS:: Type ;
19
19
20
20
/**
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.
22
23
*/
23
- private predicate isIrrellevantObjectOveride ( CS:: Callable api ) {
24
+ private predicate isIrrelevantOverrideOrImplementation ( CS:: Callable api ) {
24
25
exists ( System:: SystemObjectClass c |
25
26
api = c .getGetHashCodeMethod ( ) .getAnOverrider * ( ) or
26
27
api = c .getEqualsMethod ( ) .getAnOverrider * ( )
27
28
)
29
+ or
30
+ exists ( System:: IEquatableEqualsMethod equals | equals = api )
28
31
}
29
32
30
33
/**
@@ -35,7 +38,7 @@ private predicate isRelevantForModels(CS::Callable api) {
35
38
api .getDeclaringType ( ) .getNamespace ( ) .getQualifiedName ( ) != "" and
36
39
not api instanceof CS:: ConversionOperator and
37
40
not api instanceof Util:: MainMethod and
38
- not isIrrellevantObjectOveride ( api )
41
+ not isIrrelevantOverrideOrImplementation ( api )
39
42
}
40
43
41
44
/**
Original file line number Diff line number Diff line change @@ -42,4 +42,22 @@ public int ReturnParam(int input)
42
42
}
43
43
}
44
44
}
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
+ }
45
63
}
You can’t perform that action at this time.
0 commit comments