Skip to content

Commit d3d20c6

Browse files
authored
Merge pull request #8425 from hvitved/csharp/structural-comparision-fix
C#: Avoid combinatorial explosion in structural comparison library
2 parents 5102cad + 06b8f74 commit d3d20c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

csharp/ql/lib/semmle/code/csharp/commons/StructuralComparison.qll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ private class GvnCons extends Gvn, TGvnCons {
8787
pragma[noinline]
8888
private predicate gvnKindDeclaration(Expr e, int kind, boolean isTargetThis, Declaration d) {
8989
isTargetThis = isTargetThis(e) and
90-
d = referenceAttribute(e) and
90+
// guard against elements with multiple declaration targets (DB inconsistency),
91+
// which may result in a combinatorial explosion
92+
d = unique(Declaration d0 | d0 = referenceAttribute(e) | d0) and
9193
expressions(e, kind, _)
9294
}
9395

0 commit comments

Comments
 (0)