@@ -14,6 +14,11 @@ private module Cached {
14
14
ReturnStep ( ) or
15
15
StoreStep ( TypeTrackerContent content ) { basicStoreStep ( _, _, content ) } or
16
16
LoadStep ( TypeTrackerContent content ) { basicLoadStep ( _, _, content ) } or
17
+ LoadStoreStep ( TypeTrackerContent load , TypeTrackerContent store ) {
18
+ basicLoadStoreStep ( _, _, load , store )
19
+ } or
20
+ WithContent ( ContentFilter filter ) { basicWithContentStep ( _, _, filter ) } or
21
+ WithoutContent ( ContentFilter filter ) { basicWithoutContentStep ( _, _, filter ) } or
17
22
JumpStep ( )
18
23
19
24
pragma [ nomagic]
@@ -35,6 +40,14 @@ private module Cached {
35
40
or
36
41
step = JumpStep ( ) and
37
42
result = MkTypeTracker ( false , currentContents )
43
+ or
44
+ exists ( ContentFilter filter | result = tt |
45
+ step = WithContent ( filter ) and
46
+ currentContents = filter .getAMatchingContent ( )
47
+ or
48
+ step = WithoutContent ( filter ) and
49
+ not currentContents = filter .getAMatchingContent ( )
50
+ )
38
51
)
39
52
or
40
53
exists ( TypeTrackerContent storeContents , boolean hasCall |
@@ -49,6 +62,16 @@ private module Cached {
49
62
tt = noContentTypeTracker ( hasCall ) and
50
63
result = MkTypeTracker ( hasCall , storeContents )
51
64
)
65
+ or
66
+ exists (
67
+ TypeTrackerContent currentContent , TypeTrackerContent store , TypeTrackerContent load ,
68
+ boolean hasCall
69
+ |
70
+ step = LoadStoreStep ( pragma [ only_bind_into ] ( load ) , pragma [ only_bind_into ] ( store ) ) and
71
+ compatibleContents ( pragma [ only_bind_into ] ( currentContent ) , load ) and
72
+ tt = MkTypeTracker ( pragma [ only_bind_into ] ( hasCall ) , currentContent ) and
73
+ result = MkTypeTracker ( pragma [ only_bind_out ] ( hasCall ) , store )
74
+ )
52
75
}
53
76
54
77
pragma [ nomagic]
@@ -70,6 +93,14 @@ private module Cached {
70
93
or
71
94
step = JumpStep ( ) and
72
95
result = MkTypeBackTracker ( false , content )
96
+ or
97
+ exists ( ContentFilter filter | result = tbt |
98
+ step = WithContent ( filter ) and
99
+ content = filter .getAMatchingContent ( )
100
+ or
101
+ step = WithoutContent ( filter ) and
102
+ not content = filter .getAMatchingContent ( )
103
+ )
73
104
)
74
105
or
75
106
exists ( TypeTrackerContent loadContents , boolean hasReturn |
@@ -84,6 +115,16 @@ private module Cached {
84
115
tbt = noContentTypeBackTracker ( hasReturn ) and
85
116
result = MkTypeBackTracker ( hasReturn , loadContents )
86
117
)
118
+ or
119
+ exists (
120
+ TypeTrackerContent currentContent , TypeTrackerContent store , TypeTrackerContent load ,
121
+ boolean hasCall
122
+ |
123
+ step = LoadStoreStep ( pragma [ only_bind_into ] ( load ) , pragma [ only_bind_into ] ( store ) ) and
124
+ compatibleContents ( store , pragma [ only_bind_into ] ( currentContent ) ) and
125
+ tbt = MkTypeBackTracker ( pragma [ only_bind_into ] ( hasCall ) , currentContent ) and
126
+ result = MkTypeBackTracker ( pragma [ only_bind_out ] ( hasCall ) , load )
127
+ )
87
128
}
88
129
89
130
/**
@@ -127,6 +168,11 @@ class StepSummary extends TStepSummary {
127
168
or
128
169
exists ( TypeTrackerContent content | this = LoadStep ( content ) | result = "load " + content )
129
170
or
171
+ exists ( TypeTrackerContent load , TypeTrackerContent store |
172
+ this = LoadStoreStep ( load , store ) and
173
+ result = "load-store " + load + " -> " + store
174
+ )
175
+ or
130
176
this instanceof JumpStep and result = "jump"
131
177
}
132
178
}
@@ -145,6 +191,19 @@ private predicate smallstepNoCall(Node nodeFrom, TypeTrackingNode nodeTo, StepSu
145
191
or
146
192
basicLoadStep ( nodeFrom , nodeTo , content ) and summary = LoadStep ( content )
147
193
)
194
+ or
195
+ exists ( TypeTrackerContent loadContent , TypeTrackerContent storeContent |
196
+ StepSummary:: localSourceLoadStoreStep ( nodeFrom , nodeTo , loadContent , storeContent ) and
197
+ summary = LoadStoreStep ( loadContent , storeContent )
198
+ )
199
+ or
200
+ exists ( ContentFilter filter |
201
+ basicWithContentStep ( nodeFrom , nodeTo , filter ) and
202
+ summary = WithContent ( filter )
203
+ or
204
+ basicWithoutContentStep ( nodeFrom , nodeTo , filter ) and
205
+ summary = WithoutContent ( filter )
206
+ )
148
207
}
149
208
150
209
pragma [ noinline]
@@ -216,6 +275,18 @@ module StepSummary {
216
275
predicate localSourceStoreStep ( Node nodeFrom , TypeTrackingNode nodeTo , TypeTrackerContent content ) {
217
276
exists ( Node obj | nodeTo .flowsTo ( obj ) and basicStoreStep ( nodeFrom , obj , content ) )
218
277
}
278
+
279
+ /**
280
+ * Holds if `loadContent` is loaded from `nodeFrom` and written to `storeContent` of `nodeTo`.
281
+ */
282
+ predicate localSourceLoadStoreStep (
283
+ Node nodeFrom , TypeTrackingNode nodeTo , TypeTrackerContent loadContent ,
284
+ TypeTrackerContent storeContent
285
+ ) {
286
+ exists ( Node obj |
287
+ nodeTo .flowsTo ( obj ) and basicLoadStoreStep ( nodeFrom , obj , loadContent , storeContent )
288
+ )
289
+ }
219
290
}
220
291
221
292
private newtype TTypeTracker =
0 commit comments