File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
csharp/ql/lib/semmle/code/csharp/dataflow/internal Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1984,6 +1984,21 @@ private class DataFlowUnknownType extends DataFlowType {
1984
1984
DataFlowUnknownType ( ) { this = Gvn:: getGlobalValueNumber ( any ( UnknownType ut ) ) }
1985
1985
}
1986
1986
1987
+ private predicate uselessTypebound ( DataFlowType t ) {
1988
+ t instanceof DataFlowUnknownType or
1989
+ t instanceof Gvn:: TypeParameterGvnType
1990
+ }
1991
+
1992
+ pragma [ nomagic]
1993
+ predicate typeStrongerThan ( DataFlowType t1 , DataFlowType t2 ) {
1994
+ t1 != t2 and
1995
+ t1 = getANonTypeParameterSubTypeRestricted ( t2 )
1996
+ or
1997
+ t1 instanceof RelevantDataFlowType and
1998
+ not uselessTypebound ( t1 ) and
1999
+ uselessTypebound ( t2 )
2000
+ }
2001
+
1987
2002
/**
1988
2003
* Holds if `t1` and `t2` are compatible, that is, whether data can flow from
1989
2004
* a node of type `t1` to a node of type `t2`.
You can’t perform that action at this time.
0 commit comments