@@ -195,7 +195,10 @@ module Public {
195
195
}
196
196
197
197
/** 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
+
199
202
/**
200
203
* Holds if data may flow from `input` to `output` through this callable.
201
204
*
@@ -493,7 +496,7 @@ module Private {
493
496
or
494
497
exists ( ParameterPosition pos |
495
498
parameterReadState ( c , state , pos ) and
496
- result .( ParamNode ) .isParameterOf ( c , pos )
499
+ result .( ParamNode ) .isParameterOf ( inject ( c ) , pos )
497
500
)
498
501
)
499
502
}
@@ -621,7 +624,7 @@ module Private {
621
624
predicate summaryPostUpdateNode ( Node post , Node pre ) {
622
625
exists ( SummarizedCallable c , ParameterPosition pos |
623
626
isParameterPostUpdate ( post , c , pos ) and
624
- pre .( ParamNode ) .isParameterOf ( c , pos )
627
+ pre .( ParamNode ) .isParameterOf ( inject ( c ) , pos )
625
628
)
626
629
or
627
630
exists ( SummarizedCallable callable , SummaryComponentStack s |
@@ -644,7 +647,7 @@ module Private {
644
647
* node, and back out to `p`.
645
648
*/
646
649
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 ) |
648
651
exists ( SummaryComponentStack inputContents , SummaryComponentStack outputContents |
649
652
summary ( c , inputContents , outputContents , _) and
650
653
inputContents .bottom ( ) = pragma [ only_bind_into ] ( TArgumentSummaryComponent ( ppos ) ) and
@@ -748,8 +751,11 @@ module Private {
748
751
private predicate viableParam (
749
752
DataFlowCall call , SummarizedCallable sc , ParameterPosition ppos , ParamNode p
750
753
) {
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
+ )
753
759
}
754
760
755
761
pragma [ nomagic]
@@ -1067,16 +1073,18 @@ module Private {
1067
1073
/** Provides a query predicate for outputting a set of relevant flow summaries. */
1068
1074
module TestOutput {
1069
1075
/** A flow summary to include in the `summary/3` query predicate. */
1070
- abstract class RelevantSummarizedCallable extends SummarizedCallable {
1076
+ abstract class RelevantSummarizedCallable instanceof SummarizedCallable {
1071
1077
/** Gets the string representation of this callable used by `summary/1`. */
1072
1078
abstract string getCallableCsv ( ) ;
1073
1079
1074
1080
/** Holds if flow is propagated between `input` and `output`. */
1075
1081
predicate relevantSummary (
1076
1082
SummaryComponentStack input , SummaryComponentStack output , boolean preservesValue
1077
1083
) {
1078
- this .propagatesFlow ( input , output , preservesValue )
1084
+ super .propagatesFlow ( input , output , preservesValue )
1079
1085
}
1086
+
1087
+ string toString ( ) { result = super .toString ( ) }
1080
1088
}
1081
1089
1082
1090
/** Render the kind in the format used in flow summaries. */
@@ -1087,7 +1095,7 @@ module Private {
1087
1095
}
1088
1096
1089
1097
private string renderGenerated ( RelevantSummarizedCallable c ) {
1090
- if c .isAutoGenerated ( ) then result = "generated:" else result = ""
1098
+ if c .( SummarizedCallable ) . isAutoGenerated ( ) then result = "generated:" else result = ""
1091
1099
}
1092
1100
1093
1101
/**
@@ -1117,19 +1125,21 @@ module Private {
1117
1125
*/
1118
1126
module RenderSummarizedCallable {
1119
1127
/** 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
+ }
1121
1131
1122
1132
private newtype TNodeOrCall =
1123
1133
MkNode ( Node n ) {
1124
1134
exists ( RelevantSummarizedCallable c |
1125
1135
n = summaryNode ( c , _)
1126
1136
or
1127
- n .( ParamNode ) .isParameterOf ( c , _)
1137
+ n .( ParamNode ) .isParameterOf ( inject ( c ) , _)
1128
1138
)
1129
1139
} or
1130
1140
MkCall ( DataFlowCall call ) {
1131
1141
call = summaryDataFlowCall ( _) and
1132
- call .getEnclosingCallable ( ) instanceof RelevantSummarizedCallable
1142
+ call .getEnclosingCallable ( ) = inject ( any ( RelevantSummarizedCallable c ) )
1133
1143
}
1134
1144
1135
1145
private class NodeOrCall extends TNodeOrCall {
0 commit comments