@@ -97,24 +97,14 @@ private module SummaryTypeTrackerInput implements SummaryTypeTracker::Input {
9797
9898private module TypeTrackerSummaryFlow = SummaryTypeTracker:: SummaryFlow< SummaryTypeTrackerInput > ;
9999
100- /**
101- * Gets the name of a possible piece of content. For Python, this is currently only attribute names,
102- * using the name of the attribute for the corresponding content.
103- */
104- private string getPossibleContentName ( ) {
105- Stages:: TypeTracking:: ref ( ) and // the TypeTracking::append() etc. predicates that we want to cache depend on this predicate, so we can place the `ref()` call here to get around identical files.
106- result = any ( DataFlowPublic:: AttrRef a ) .getAttributeName ( )
107- }
108-
109100module TypeTrackingInput implements Shared:: TypeTrackingInput {
110101 class Node = DataFlowPublic:: Node ;
111102
112103 class LocalSourceNode = DataFlowPublic:: LocalSourceNode ;
113104
114- class Content instanceof string {
115- Content ( ) { this = getPossibleContentName ( ) }
116-
117- string toString ( ) { result = this }
105+ class Content extends DataFlowPublic:: Content {
106+ // this char-pred is just a temporary restriction while transitioning to more general content
107+ Content ( ) { this instanceof DataFlowPublic:: AttributeContent }
118108 }
119109
120110 /**
@@ -181,46 +171,35 @@ module TypeTrackingInput implements Shared::TypeTrackingInput {
181171 * Holds if `nodeFrom` is being written to the `content` content of the object in `nodeTo`.
182172 */
183173 predicate storeStep ( Node nodeFrom , Node nodeTo , Content content ) {
184- exists ( DataFlowPublic:: AttrWrite a |
185- a .mayHaveAttributeName ( content ) and
174+ exists ( DataFlowPublic:: AttrWrite a , string attrName |
175+ content .( DataFlowPublic:: AttributeContent ) .getAttribute ( ) = attrName and
176+ a .mayHaveAttributeName ( attrName ) and
186177 nodeFrom = a .getValue ( ) and
187178 nodeTo = a .getObject ( )
188179 )
189180 or
190- exists ( DataFlowPublic:: ContentSet contents |
191- contents .( DataFlowPublic:: AttributeContent ) .getAttribute ( ) = content
192- |
193- TypeTrackerSummaryFlow:: basicStoreStep ( nodeFrom , nodeTo , contents )
194- )
181+ TypeTrackerSummaryFlow:: basicStoreStep ( nodeFrom , nodeTo , content )
195182 }
196183
197184 /**
198185 * Holds if `nodeTo` is the result of accessing the `content` content of `nodeFrom`.
199186 */
200187 predicate loadStep ( Node nodeFrom , LocalSourceNode nodeTo , Content content ) {
201- exists ( DataFlowPublic:: AttrRead a |
202- a .mayHaveAttributeName ( content ) and
188+ exists ( DataFlowPublic:: AttrRead a , string attrName |
189+ content .( DataFlowPublic:: AttributeContent ) .getAttribute ( ) = attrName and
190+ a .mayHaveAttributeName ( attrName ) and
203191 nodeFrom = a .getObject ( ) and
204192 nodeTo = a
205193 )
206194 or
207- exists ( DataFlowPublic:: ContentSet contents |
208- contents .( DataFlowPublic:: AttributeContent ) .getAttribute ( ) = content
209- |
210- TypeTrackerSummaryFlow:: basicLoadStep ( nodeFrom , nodeTo , contents )
211- )
195+ TypeTrackerSummaryFlow:: basicLoadStep ( nodeFrom , nodeTo , content )
212196 }
213197
214198 /**
215199 * Holds if the `loadContent` of `nodeFrom` is stored in the `storeContent` of `nodeTo`.
216200 */
217201 predicate loadStoreStep ( Node nodeFrom , Node nodeTo , Content loadContent , Content storeContent ) {
218- exists ( DataFlowPublic:: ContentSet loadContents , DataFlowPublic:: ContentSet storeContents |
219- loadContents .( DataFlowPublic:: AttributeContent ) .getAttribute ( ) = loadContent and
220- storeContents .( DataFlowPublic:: AttributeContent ) .getAttribute ( ) = storeContent
221- |
222- TypeTrackerSummaryFlow:: basicLoadStoreStep ( nodeFrom , nodeTo , loadContents , storeContents )
223- )
202+ TypeTrackerSummaryFlow:: basicLoadStoreStep ( nodeFrom , nodeTo , loadContent , storeContent )
224203 }
225204
226205 /**
0 commit comments