@@ -12,18 +12,28 @@ private import sharedlib.FlowSummaryImpl::Private as Private
1212private import sharedlib.FlowSummaryImpl:: Public
1313private import codeql.dataflow.internal.AccessPathSyntax as AccessPathSyntax
1414private import semmle.javascript.internal.flow_summaries.ExceptionFlow
15+ private import codeql.util.Void
1516
1617/**
1718 * A class of callables that are candidates for flow summary modeling.
1819 */
19- class SummarizedCallableBase = string ;
20+ class SummarizedCallableBase extends string {
21+ bindingset [ this ]
22+ SummarizedCallableBase ( ) { exists ( this ) }
2023
21- class SourceBase extends Unit {
22- SourceBase ( ) { none ( ) }
24+ Location getLocation ( ) { none ( ) }
2325}
2426
25- class SinkBase extends Unit {
26- SinkBase ( ) { none ( ) }
27+ class SourceBase extends Void {
28+ Location getLocation ( ) { none ( ) }
29+ }
30+
31+ class SinkBase = SourceBase ;
32+
33+ class FlowSummaryCallBase = SourceBase ;
34+
35+ DataFlowCallable getSummarizedCallableAsDataFlowCallable ( SummarizedCallableBase c ) {
36+ result .asLibraryCallable ( ) = c
2737}
2838
2939/** Gets the parameter position representing a callback itself, if any. */
@@ -141,8 +151,41 @@ string encodeArgumentPosition(ArgumentPosition pos) {
141151/** Gets the return kind corresponding to specification `"ReturnValue"`. */
142152ReturnKind getStandardReturnValueKind ( ) { result = MkNormalReturnKind ( ) and Stage:: ref ( ) }
143153
144- private module FlowSummaryStepInput implements Private:: StepsInputSig {
145- Private:: SummaryNode getSummaryNode ( DataFlow:: Node n ) {
154+ private module Input2 implements Private:: InputSig2 {
155+ private import codeql.util.Void
156+
157+ class SourceSinkReportingElement extends Void {
158+ Location getLocation ( ) { none ( ) }
159+
160+ DataFlowCallable getEnclosingCallable ( ) { none ( ) }
161+ }
162+
163+ bindingset [ source, s]
164+ SourceSinkReportingElement getSourceEntryElement (
165+ SourceElement source , Private:: SummaryComponentStack s
166+ ) {
167+ none ( )
168+ }
169+
170+ bindingset [ e, s]
171+ DataFlow:: Node getSourceExitNode ( SourceSinkReportingElement e , Private:: SummaryComponentStack s ) {
172+ none ( )
173+ }
174+
175+ SourceSinkReportingElement getSinkExitElement ( SinkElement sink , Private:: SummaryComponent sc ) {
176+ none ( )
177+ }
178+
179+ bindingset [ e, sc]
180+ DataFlow:: Node getSinkEntryNode ( SourceSinkReportingElement e , Private:: SummaryComponent sc ) {
181+ none ( )
182+ }
183+ }
184+
185+ import Private:: Make2< Input2 > as Impl2
186+
187+ private module FlowSummaryStepInput implements Impl2:: StepsInputSig {
188+ Impl2:: SummaryNode getSummaryNode ( DataFlow:: Node n ) {
146189 result = n .( FlowSummaryNode ) .getSummaryNode ( )
147190 }
148191
@@ -156,12 +199,6 @@ private module FlowSummaryStepInput implements Private::StepsInputSig {
156199 ]
157200 )
158201 }
159-
160- DataFlowCallable getSourceNodeEnclosingCallable ( SourceBase source ) { none ( ) }
161-
162- DataFlow:: Node getSourceNode ( SourceBase source , Private:: SummaryComponentStack s ) { none ( ) }
163-
164- DataFlow:: Node getSinkNode ( SinkBase sink , Private:: SummaryComponent sc ) { none ( ) }
165202}
166203
167204module Steps = Private:: Steps< FlowSummaryStepInput > ;
0 commit comments