Skip to content

Commit df8e04f

Browse files
committed
Add predicate neutralElement matching summaryElement
1 parent 209fe73 commit df8e04f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

go/ql/lib/semmle/go/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,17 @@ module Private {
298298
interpretElement(namespace, type, subtypes, name, signature, ext).asEntity()
299299
)
300300
}
301+
302+
/**
303+
* Holds if a neutral model exists for `c` of kind `kind`
304+
* and with provenance `provenance`.
305+
*/
306+
predicate neutralElement(Input::SummarizedCallableBase c, string kind, string provenance) {
307+
exists(string namespace, string type, string name, string signature |
308+
neutralModel(namespace, type, name, signature, kind, provenance) and
309+
c.asFunction() = interpretElement(namespace, type, false, name, signature, "").asEntity()
310+
)
311+
}
301312
}
302313

303314
/**

0 commit comments

Comments
 (0)