Skip to content

Commit e2008e1

Browse files
committed
Move summaryElement to FlowSummyImpl.qll
1 parent 7f0f2d3 commit e2008e1

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

go/ql/lib/semmle/go/dataflow/ExternalFlow.qll

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -415,20 +415,6 @@ predicate sourceNode(DataFlow::Node node, string kind) { sourceNode(node, kind,
415415
*/
416416
predicate sinkNode(DataFlow::Node node, string kind) { sinkNode(node, kind, _) }
417417

418-
private predicate summaryElement(
419-
Callable c, string input, string output, string kind, string provenance, string model
420-
) {
421-
exists(
422-
string namespace, string type, boolean subtypes, string name, string signature, string ext,
423-
QlBuiltins::ExtensionId madId
424-
|
425-
summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind, provenance,
426-
madId) and
427-
model = "MaD:" + madId.toString() and
428-
c.asFunction() = interpretElement(namespace, type, subtypes, name, signature, ext).asEntity()
429-
)
430-
}
431-
432418
// adapter class for converting Mad summaries to `SummarizedCallable`s
433419
private class SummarizedCallableAdapter extends SummarizedCallable {
434420
SummarizedCallableAdapter() { summaryElement(this, _, _, _, _, _) }

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,25 @@ module Private {
278278
module External {
279279
import Impl::Private::External
280280
import Impl::Private::External::SourceSinkInterpretation<SourceSinkInterpretationInput>
281+
282+
/**
283+
* Holds if an external flow summary exists for `c` with input specification
284+
* `input`, output specification `output`, kind `kind`, and provenance `provenance`.
285+
*/
286+
predicate summaryElement(
287+
Callable c, string input, string output, string kind, string provenance, string model
288+
) {
289+
exists(
290+
string namespace, string type, boolean subtypes, string name, string signature, string ext,
291+
QlBuiltins::ExtensionId madId
292+
|
293+
summaryModel(namespace, type, subtypes, name, signature, ext, input, output, kind,
294+
provenance, madId) and
295+
model = "MaD:" + madId.toString() and
296+
c.asFunction() =
297+
interpretElement(namespace, type, subtypes, name, signature, ext).asEntity()
298+
)
299+
}
281300
}
282301

283302
/**

0 commit comments

Comments
 (0)