Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ql/ql/src/codeql_ql/ast/internal/Module.qll
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ module ModConsistency {
) >= 2 and
// paramerized modules are not treated nicely, so we ignore them here.
not i.getResolvedModule().getEnclosing*().asModule().hasParameter(_, _, _) and
not i.getResolvedModule().asModule().hasAnnotation("signature") and
not i.getLocation()
.getFile()
.getAbsolutePath()
Expand Down
6 changes: 4 additions & 2 deletions ql/ql/src/codeql_ql/ast/internal/Predicate.qll
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,9 @@ module PredConsistency {
c > 1 and
resolvePredicateExpr(pe, p) and
// parameterized modules are expected to resolve to multiple.
not exists(ClasslessPredicate sig | not sig.isSignature() and resolvePredicateExpr(pe, sig))
not exists(Predicate sig | sig.getParent*().hasAnnotation("signature") |
resolvePredicateExpr(pe, sig)
)
}

query predicate multipleResolveCall(Call call, int c, PredicateOrBuiltin p) {
Expand All @@ -227,6 +229,6 @@ module PredConsistency {
c > 1 and
resolveCall(call, p) and
// parameterized modules are expected to resolve to multiple.
not exists(ClasslessPredicate sig | not sig.isSignature() and resolveCall(call, sig))
not exists(Predicate sig | sig.getParent*().hasAnnotation("signature") | resolveCall(call, sig))
}
}
7 changes: 4 additions & 3 deletions ql/ql/src/queries/diagnostics/EmptyConsistencies.ql
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ where
PredConsistency::noResolvePredicateExpr(node) and
msg = "PredConsistency::noResolvePredicateExpr"
or
PredConsistency::multipleResolveCall(node, _, _) and
msg = "PredConsistency::multipleResolveCall"
or
// This went out the window with parameterised modules.
// PredConsistency::multipleResolveCall(node, _, _) and
// msg = "PredConsistency::multipleResolveCall"
// or
PredConsistency::multipleResolvePredicateExpr(node, _, _) and
msg = "PredConsistency::multipleResolvePredicateExpr"
or
Expand Down