@@ -246,6 +246,15 @@ abstract class Configuration extends string {
246246 predicate isAdditionalLoadStoreStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) {
247247 none ( )
248248 }
249+
250+ /**
251+ * EXPERIMENTAL. This API may change in the future.
252+ *
253+ * Holds if the property `loadProp` should be copied from the object `pred` to the property `storeProp` of object `succ`.
254+ */
255+ predicate isAdditionalLoadStoreStep ( DataFlow:: Node pred , DataFlow:: Node succ , string loadProp , string storeProp ) {
256+ none ( )
257+ }
249258}
250259
251260/**
@@ -515,6 +524,17 @@ abstract class AdditionalFlowStep extends DataFlow::Node {
515524 */
516525 cached
517526 predicate loadStoreStep ( DataFlow:: Node pred , DataFlow:: Node succ , string prop ) { none ( ) }
527+
528+ /**
529+ * EXPERIMENTAL. This API may change in the future.
530+ *
531+ * Holds if the property `loadProp` should be copied from the object `pred` to the property `storeProp` of object `succ`.
532+ */
533+ cached
534+ predicate loadStoreStep ( DataFlow:: Node pred , DataFlow:: Node succ , string loadProp , string storeProp ) {
535+ loadProp = storeProp and
536+ loadStoreStep ( pred , succ , loadProp )
537+ }
518538}
519539
520540/**
@@ -619,7 +639,7 @@ private predicate exploratoryFlowStep(
619639 basicLoadStep ( pred , succ , _) or
620640 isAdditionalStoreStep ( pred , succ , _, cfg ) or
621641 isAdditionalLoadStep ( pred , succ , _, cfg ) or
622- isAdditionalLoadStoreStep ( pred , succ , _, cfg ) or
642+ isAdditionalLoadStoreStep ( pred , succ , _, _ , cfg ) or
623643 // the following two disjuncts taken together over-approximate flow through
624644 // higher-order calls
625645 callback ( pred , succ ) or
@@ -859,14 +879,21 @@ private predicate isAdditionalStoreStep(
859879}
860880
861881/**
862- * Holds if the property `prop ` should be copied from the object `pred` to the object `succ`.
882+ * Holds if the property `loadProp ` should be copied from the object `pred` to the property `storeProp` of object `succ`.
863883 */
864884private predicate isAdditionalLoadStoreStep (
865- DataFlow:: Node pred , DataFlow:: Node succ , string prop , DataFlow:: Configuration cfg
885+ DataFlow:: Node pred , DataFlow:: Node succ , string loadProp , string storeProp , DataFlow:: Configuration cfg
866886) {
867- any ( AdditionalFlowStep s ) .loadStoreStep ( pred , succ , prop )
887+ any ( AdditionalFlowStep s ) .loadStoreStep ( pred , succ , loadProp , storeProp )
888+ or
889+ cfg .isAdditionalLoadStoreStep ( pred , succ , loadProp , storeProp )
868890 or
869- cfg .isAdditionalLoadStoreStep ( pred , succ , prop )
891+ loadProp = storeProp and
892+ (
893+ any ( AdditionalFlowStep s ) .loadStoreStep ( pred , succ , loadProp )
894+ or
895+ cfg .isAdditionalLoadStoreStep ( pred , succ , loadProp )
896+ )
870897}
871898
872899/**
@@ -904,12 +931,14 @@ private predicate reachableFromStoreBase(
904931 or
905932 exists ( DataFlow:: Node mid , PathSummary oldSummary , PathSummary newSummary |
906933 reachableFromStoreBase ( prop , rhs , mid , cfg , oldSummary ) and
907- (
908- flowStep ( mid , cfg , nd , newSummary )
909- or
910- isAdditionalLoadStoreStep ( mid , nd , prop , cfg ) and
911- newSummary = PathSummary:: level ( )
912- ) and
934+ flowStep ( mid , cfg , nd , newSummary ) and
935+ summary = oldSummary .appendValuePreserving ( newSummary )
936+ )
937+ or
938+ exists ( DataFlow:: Node mid , PathSummary oldSummary , PathSummary newSummary , string midProp |
939+ reachableFromStoreBase ( midProp , rhs , mid , cfg , oldSummary ) and
940+ isAdditionalLoadStoreStep ( mid , nd , midProp , prop , cfg ) and
941+ newSummary = PathSummary:: level ( ) and
913942 summary = oldSummary .appendValuePreserving ( newSummary )
914943 )
915944}
0 commit comments