Skip to content

Commit faf33ef

Browse files
committed
C#: Improve join ordering further for InterpretedCallable.
1 parent 32816fa commit faf33ef

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/ExternalFlow.qll

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,17 @@ private predicate callableSpecInfo(Callable c, string namespace, string type, st
511511
}
512512

513513
pragma[nomagic]
514-
private predicate subtypeSpecCandidate(Callable c, UnboundValueOrRefType t) {
515-
elementSpec(_, _, true, c.getName(), _, _, t)
514+
private predicate subtypeSpecCandidate(string name, UnboundValueOrRefType t) {
515+
exists(UnboundValueOrRefType t0 |
516+
elementSpec(_, _, true, name, _, _, t0) and
517+
t = t0.getASubTypeUnbound+()
518+
)
519+
}
520+
521+
pragma[nomagic]
522+
private predicate callableInfo(Callable c, string name, UnboundValueOrRefType decl) {
523+
name = c.getName() and
524+
decl = c.getDeclaringType()
516525
}
517526

518527
private class InterpretedCallable extends Callable {
@@ -522,9 +531,9 @@ private class InterpretedCallable extends Callable {
522531
elementSpec(namespace, type, _, name, _, _)
523532
)
524533
or
525-
exists(UnboundValueOrRefType t |
526-
subtypeSpecCandidate(this, t) and
527-
this.getDeclaringType() = t.getASubTypeUnbound+()
534+
exists(string name, UnboundValueOrRefType t |
535+
callableInfo(this, name, t) and
536+
subtypeSpecCandidate(name, t)
528537
)
529538
}
530539
}

0 commit comments

Comments
 (0)