File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 9
9
private import javascript
10
10
private import internal.FlowSteps
11
11
private import internal.StepSummary
12
+ private import semmle.javascript.internal.CachedStages
12
13
13
14
private newtype TTypeTracker = MkTypeTracker ( Boolean hasCall , OptionalPropertyName prop )
14
15
@@ -51,7 +52,9 @@ class TypeTracker extends TTypeTracker {
51
52
/** Gets the summary resulting from appending `step` to this type-tracking summary. */
52
53
cached
53
54
TypeTracker append ( StepSummary step ) {
54
- step = LevelStep ( ) and result = this
55
+ Stages:: TypeTracking:: ref ( ) and
56
+ step = LevelStep ( ) and
57
+ result = this
55
58
or
56
59
exists ( string toProp | step = LoadStoreStep ( prop , toProp ) |
57
60
result = MkTypeTracker ( hasCall , toProp )
@@ -214,8 +217,11 @@ class TypeBackTracker extends TTypeBackTracker {
214
217
TypeBackTracker ( ) { this = MkTypeBackTracker ( hasReturn , prop ) }
215
218
216
219
/** Gets the summary resulting from prepending `step` to this type-tracking summary. */
220
+ cached
217
221
TypeBackTracker prepend ( StepSummary step ) {
218
- step = LevelStep ( ) and result = this
222
+ Stages:: TypeTracking:: ref ( ) and
223
+ step = LevelStep ( ) and
224
+ result = this
219
225
or
220
226
exists ( string fromProp | step = LoadStoreStep ( fromProp , prop ) |
221
227
result = MkTypeBackTracker ( hasReturn , fromProp )
Original file line number Diff line number Diff line change @@ -181,6 +181,10 @@ module Stages {
181
181
PreCallGraphStep:: loadStep ( _, _, _)
182
182
or
183
183
basicLoadStep ( _, _, _)
184
+ or
185
+ exists ( any ( DataFlow:: TypeTracker t ) .append ( _) )
186
+ or
187
+ exists ( any ( DataFlow:: TypeBackTracker t ) .prepend ( _) )
184
188
}
185
189
}
186
190
You can’t perform that action at this time.
0 commit comments