@@ -1175,6 +1175,7 @@ private predicate parameterPropReadStep(
1175
1175
invk = getAwaitOperand ( succ )
1176
1176
) and
1177
1177
callInputStep ( f , invk , arg , parm , cfg ) and
1178
+ prop = pragma [ only_bind_into ] ( getARelevantProp ( cfg ) ) and
1178
1179
(
1179
1180
read = parm .getAPropertyRead ( prop )
1180
1181
or
@@ -1192,7 +1193,7 @@ private predicate reachesReturn(
1192
1193
isRelevant ( read , cfg ) and
1193
1194
returnExpr ( f , read , _) and
1194
1195
summary = PathSummary:: level ( ) and
1195
- callInputStep ( f , _, _, _ , _) // check that a relevant result can exist.
1196
+ parameterPropReadStep ( _ , _, _, cfg , _ , _ , f , _) // check that a relevant result can exist.
1196
1197
or
1197
1198
exists ( DataFlow:: Node mid , PathSummary oldSummary , PathSummary newSummary |
1198
1199
flowStep ( read , cfg , mid , oldSummary ) and
@@ -1202,6 +1203,33 @@ private predicate reachesReturn(
1202
1203
)
1203
1204
}
1204
1205
1206
+ // used in `getARelevantProp`, outlined for performance
1207
+ pragma [ noinline]
1208
+ private string getARelevantStoreProp ( DataFlow:: Configuration cfg ) {
1209
+ exists ( DataFlow:: Node previous | isRelevant ( previous , cfg ) |
1210
+ basicStoreStep ( previous , _, result ) or
1211
+ isAdditionalStoreStep ( previous , _, result , cfg )
1212
+ )
1213
+ }
1214
+
1215
+ // used in `getARelevantProp`, outlined for performance
1216
+ pragma [ noinline]
1217
+ private string getARelevantLoadProp ( DataFlow:: Configuration cfg ) {
1218
+ exists ( DataFlow:: Node previous | isRelevant ( previous , cfg ) |
1219
+ basicLoadStep ( previous , _, result ) or
1220
+ isAdditionalLoadStep ( previous , _, result , cfg )
1221
+ )
1222
+ }
1223
+
1224
+ /** Gets the name of a property that is both loaded and stored according to the exploratory analysis. */
1225
+ pragma [ noinline]
1226
+ private string getARelevantProp ( DataFlow:: Configuration cfg ) {
1227
+ result = getARelevantStoreProp ( cfg ) and
1228
+ result = getARelevantLoadProp ( cfg )
1229
+ or
1230
+ result = getAPropertyUsedInLoadStore ( cfg )
1231
+ }
1232
+
1205
1233
/**
1206
1234
* Holds if the property `prop` of the object `pred` should be loaded into `succ`.
1207
1235
*/
@@ -1275,6 +1303,7 @@ private predicate reachableFromStoreBase(
1275
1303
) {
1276
1304
exists ( TPathSummary s1 , TPathSummary s2 , DataFlow:: Node rhs |
1277
1305
storeStep ( rhs , nd , startProp , cfg , s2 ) and
1306
+ startProp = getARelevantProp ( cfg ) and
1278
1307
endProp = startProp and
1279
1308
base = nd and
1280
1309
exists ( boolean hasCall , DataFlow:: FlowLabel data |
@@ -1300,6 +1329,7 @@ private predicate reachableFromStoreBase(
1300
1329
exists ( string midProp |
1301
1330
reachableFromStoreBase ( startProp , midProp , base , mid , cfg , oldSummary , onlyRelevantInCall ) and
1302
1331
isAdditionalLoadStoreStep ( mid , nd , midProp , endProp , cfg ) and
1332
+ endProp = getARelevantProp ( cfg ) and
1303
1333
newSummary = PathSummary:: level ( )
1304
1334
)
1305
1335
|
0 commit comments