Skip to content

Commit 6b7d84a

Browse files
committed
QL: exclude fields that are uniquely used in call to an IPA constructor
1 parent 6e9771f commit 6b7d84a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ql/ql/src/queries/style/FieldOnlyUsedInCharPred.ql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,10 @@ where
1616
forex(FieldAccess access | access.getDeclaration() = f |
1717
access.getEnclosingPredicate() = c.getCharPred()
1818
) and
19+
// excluding fields that are uniquely used in call to an IPA constructor
20+
not unique(FieldAccess access | access.getDeclaration() = f | access) =
21+
any(PredicateCall call |
22+
call.getEnclosingPredicate() = c.getCharPred() and call.getTarget() instanceof NewTypeBranch
23+
).getAnArgument() and
1924
not f.getVarDecl().overrides(_)
2025
select f, "Field is only used in CharPred"

0 commit comments

Comments
 (0)