File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
csharp/ql/src/Language Abuse Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -86,16 +86,21 @@ class ExplicitUpcast extends ExplicitCast {
8686 src != dest // Handled by `cs/useless-cast-to-self`
8787 }
8888
89- /** Holds if this upcast is the argument of a call to `target`. */
90- private predicate isArgument ( Call c , Callable target ) {
89+ pragma [ nomagic ]
90+ private predicate isArgument ( Type t ) {
9191 exists ( Parameter p |
9292 this = p .getAnAssignedArgument ( ) and
93- p .getType ( ) = this .getType ( ) and
94- c .getAnArgument ( ) = this and
95- target = c .getTarget ( )
93+ t = p .getType ( )
9694 )
9795 }
9896
97+ /** Holds if this upcast is the argument of a call to `target`. */
98+ private predicate isArgument ( Call c , Callable target ) {
99+ this .isArgument ( this .getType ( ) ) and
100+ c .getAnArgument ( ) = this and
101+ target = c .getTarget ( )
102+ }
103+
99104 /** Holds if this upcast may be used to disambiguate the target of an instance call. */
100105 pragma [ nomagic]
101106 private predicate isDisambiguatingInstanceCall ( InstanceCallable other , int args ) {
You can’t perform that action at this time.
0 commit comments