@@ -1012,6 +1012,9 @@ private module Stage2 {
1012
1012
1013
1013
private predicate flowIntoCall = flowIntoCallNodeCand1 / 5 ;
1014
1014
1015
+ bindingset [ node, ap]
1016
+ private predicate filter ( NodeEx node , Ap ap ) { any ( ) }
1017
+
1015
1018
bindingset [ ap, contentType]
1016
1019
private predicate typecheckStore ( Ap ap , DataFlowType contentType ) { any ( ) }
1017
1020
@@ -1020,6 +1023,13 @@ private module Stage2 {
1020
1023
PrevStage:: revFlow ( node , _, _, apa , config )
1021
1024
}
1022
1025
1026
+ bindingset [ result , apa]
1027
+ private ApApprox unbindApa ( ApApprox apa ) {
1028
+ exists ( ApApprox apa0 |
1029
+ apa = pragma [ only_bind_into ] ( apa0 ) and result = pragma [ only_bind_into ] ( apa0 )
1030
+ )
1031
+ }
1032
+
1023
1033
pragma [ nomagic]
1024
1034
private predicate flowThroughOutOfCall (
1025
1035
DataFlowCall call , CcCall ccc , RetNodeEx ret , NodeEx out , boolean allowsFieldFlow ,
@@ -1042,6 +1052,13 @@ private module Stage2 {
1042
1052
*/
1043
1053
pragma [ nomagic]
1044
1054
predicate fwdFlow ( NodeEx node , Cc cc , ApOption argAp , Ap ap , Configuration config ) {
1055
+ fwdFlow0 ( node , cc , argAp , ap , config ) and
1056
+ flowCand ( node , unbindApa ( getApprox ( ap ) ) , config ) and
1057
+ filter ( node , ap )
1058
+ }
1059
+
1060
+ pragma [ nomagic]
1061
+ private predicate fwdFlow0 ( NodeEx node , Cc cc , ApOption argAp , Ap ap , Configuration config ) {
1045
1062
flowCand ( node , _, config ) and
1046
1063
sourceNode ( node , config ) and
1047
1064
( if hasSourceCallCtx ( config ) then cc = ccSomeCall ( ) else cc = ccNone ( ) ) and
@@ -1112,7 +1129,7 @@ private module Stage2 {
1112
1129
) {
1113
1130
exists ( DataFlowType contentType |
1114
1131
fwdFlow ( node1 , cc , argAp , ap1 , config ) and
1115
- PrevStage:: storeStepCand ( node1 , getApprox ( ap1 ) , tc , node2 , contentType , config ) and
1132
+ PrevStage:: storeStepCand ( node1 , unbindApa ( getApprox ( ap1 ) ) , tc , node2 , contentType , config ) and
1116
1133
typecheckStore ( ap1 , contentType )
1117
1134
)
1118
1135
}
@@ -1189,7 +1206,7 @@ private module Stage2 {
1189
1206
) {
1190
1207
exists ( ParamNodeEx p |
1191
1208
fwdFlowIn ( call , p , cc , _, argAp , ap , config ) and
1192
- PrevStage:: parameterMayFlowThrough ( p , _, getApprox ( ap ) , config )
1209
+ PrevStage:: parameterMayFlowThrough ( p , _, unbindApa ( getApprox ( ap ) ) , config )
1193
1210
)
1194
1211
}
1195
1212
0 commit comments