@@ -195,7 +195,10 @@ module Public {
195195 }
196196
197197 /** A callable with a flow summary. */
198- abstract class SummarizedCallable extends DataFlowCallable {
198+ abstract class SummarizedCallable extends SummarizedCallableBase {
199+ bindingset [ this ]
200+ SummarizedCallable ( ) { any ( ) }
201+
199202 /**
200203 * Holds if data may flow from `input` to `output` through this callable.
201204 *
@@ -493,7 +496,7 @@ module Private {
493496 or
494497 exists ( ParameterPosition pos |
495498 parameterReadState ( c , state , pos ) and
496- result .( ParamNode ) .isParameterOf ( c , pos )
499+ result .( ParamNode ) .isParameterOf ( inject ( c ) , pos )
497500 )
498501 )
499502 }
@@ -621,7 +624,7 @@ module Private {
621624 predicate summaryPostUpdateNode ( Node post , Node pre ) {
622625 exists ( SummarizedCallable c , ParameterPosition pos |
623626 isParameterPostUpdate ( post , c , pos ) and
624- pre .( ParamNode ) .isParameterOf ( c , pos )
627+ pre .( ParamNode ) .isParameterOf ( inject ( c ) , pos )
625628 )
626629 or
627630 exists ( SummarizedCallable callable , SummaryComponentStack s |
@@ -644,7 +647,7 @@ module Private {
644647 * node, and back out to `p`.
645648 */
646649 predicate summaryAllowParameterReturnInSelf ( ParamNode p ) {
647- exists ( SummarizedCallable c , ParameterPosition ppos | p .isParameterOf ( c , ppos ) |
650+ exists ( SummarizedCallable c , ParameterPosition ppos | p .isParameterOf ( inject ( c ) , ppos ) |
648651 exists ( SummaryComponentStack inputContents , SummaryComponentStack outputContents |
649652 summary ( c , inputContents , outputContents , _) and
650653 inputContents .bottom ( ) = pragma [ only_bind_into ] ( TArgumentSummaryComponent ( ppos ) ) and
@@ -748,8 +751,11 @@ module Private {
748751 private predicate viableParam (
749752 DataFlowCall call , SummarizedCallable sc , ParameterPosition ppos , ParamNode p
750753 ) {
751- p .isParameterOf ( sc , ppos ) and
752- sc = viableCallable ( call )
754+ exists ( DataFlowCallable c |
755+ c = inject ( sc ) and
756+ p .isParameterOf ( c , ppos ) and
757+ c = viableCallable ( call )
758+ )
753759 }
754760
755761 pragma [ nomagic]
@@ -1067,16 +1073,18 @@ module Private {
10671073 /** Provides a query predicate for outputting a set of relevant flow summaries. */
10681074 module TestOutput {
10691075 /** A flow summary to include in the `summary/3` query predicate. */
1070- abstract class RelevantSummarizedCallable extends SummarizedCallable {
1076+ abstract class RelevantSummarizedCallable instanceof SummarizedCallable {
10711077 /** Gets the string representation of this callable used by `summary/1`. */
10721078 abstract string getCallableCsv ( ) ;
10731079
10741080 /** Holds if flow is propagated between `input` and `output`. */
10751081 predicate relevantSummary (
10761082 SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
10771083 ) {
1078- this .propagatesFlow ( input , output , preservesValue )
1084+ super .propagatesFlow ( input , output , preservesValue )
10791085 }
1086+
1087+ string toString ( ) { result = super .toString ( ) }
10801088 }
10811089
10821090 /** Render the kind in the format used in flow summaries. */
@@ -1087,7 +1095,7 @@ module Private {
10871095 }
10881096
10891097 private string renderGenerated ( RelevantSummarizedCallable c ) {
1090- if c .isAutoGenerated ( ) then result = "generated:" else result = ""
1098+ if c .( SummarizedCallable ) . isAutoGenerated ( ) then result = "generated:" else result = ""
10911099 }
10921100
10931101 /**
@@ -1117,19 +1125,21 @@ module Private {
11171125 */
11181126 module RenderSummarizedCallable {
11191127 /** A summarized callable to include in the graph. */
1120- abstract class RelevantSummarizedCallable extends SummarizedCallable { }
1128+ abstract class RelevantSummarizedCallable instanceof SummarizedCallable {
1129+ string toString ( ) { result = super .toString ( ) }
1130+ }
11211131
11221132 private newtype TNodeOrCall =
11231133 MkNode ( Node n ) {
11241134 exists ( RelevantSummarizedCallable c |
11251135 n = summaryNode ( c , _)
11261136 or
1127- n .( ParamNode ) .isParameterOf ( c , _)
1137+ n .( ParamNode ) .isParameterOf ( inject ( c ) , _)
11281138 )
11291139 } or
11301140 MkCall ( DataFlowCall call ) {
11311141 call = summaryDataFlowCall ( _) and
1132- call .getEnclosingCallable ( ) instanceof RelevantSummarizedCallable
1142+ call .getEnclosingCallable ( ) = inject ( any ( RelevantSummarizedCallable c ) )
11331143 }
11341144
11351145 private class NodeOrCall extends TNodeOrCall {
0 commit comments