@@ -703,14 +703,17 @@ module MakeModelGeneratorFactory<
703703 }
704704
705705 /**
706- * Holds if the access path `ap` is not a parameter or returnvalue of a callback
707- * stored in a field.
706+ * Holds if `ap` is valid for generating summary models.
708707 *
709- * That is, we currently don't include summaries that rely on parameters or return values
710- * of callbacks stored in fields.
708+ * We currently don't include summaries that rely on parameters or return values
709+ * of callbacks stored in fields, as those are not supported by the data flow
710+ * library.
711+ *
712+ * We also exclude access paths with contents not supported by `printContent`.
711713 */
712714 private predicate validateAccessPath ( PropagateContentFlow:: AccessPath ap ) {
713- not ( mentionsField ( ap ) and mentionsCallback ( ap ) )
715+ not ( mentionsField ( ap ) and mentionsCallback ( ap ) ) and
716+ forall ( int i | i in [ 0 .. ap .length ( ) - 1 ] | exists ( getContent ( ap , i ) ) )
714717 }
715718
716719 private predicate apiFlow (
@@ -720,7 +723,9 @@ module MakeModelGeneratorFactory<
720723 ) {
721724 PropagateContentFlow:: flow ( p , reads , returnNodeExt , stores , preservesValue ) and
722725 getEnclosingCallable ( returnNodeExt ) = api and
723- getEnclosingCallable ( p ) = api
726+ getEnclosingCallable ( p ) = api and
727+ validateAccessPath ( reads ) and
728+ validateAccessPath ( stores )
724729 }
725730
726731 /**
@@ -763,9 +768,7 @@ module MakeModelGeneratorFactory<
763768 PropagateContentFlow:: AccessPath reads , ReturnNodeExt returnNodeExt ,
764769 PropagateContentFlow:: AccessPath stores , boolean preservesValue
765770 ) {
766- PropagateContentFlow:: flow ( p , reads , returnNodeExt , stores , preservesValue ) and
767- getEnclosingCallable ( returnNodeExt ) = api and
768- getEnclosingCallable ( p ) = api and
771+ apiFlow ( api , p , reads , returnNodeExt , stores , preservesValue ) and
769772 p = api .getARelevantParameterNode ( )
770773 }
771774
@@ -956,8 +959,6 @@ module MakeModelGeneratorFactory<
956959 input = parameterNodeAsExactInput ( p ) + printReadAccessPath ( reads ) and
957960 output = getExactOutput ( returnNodeExt ) + printStoreAccessPath ( stores ) and
958961 input != output and
959- validateAccessPath ( reads ) and
960- validateAccessPath ( stores ) and
961962 (
962963 if mentionsField ( reads ) or mentionsField ( stores )
963964 then lift = false and api .isRelevant ( )
0 commit comments