Skip to content

Commit 1f2ab60

Browse files
committed
JS: Add store/load steps to AdditionalTypeTrackingStep
1 parent d4e1ee8 commit 1f2ab60

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

javascript/ql/src/semmle/javascript/dataflow/TypeTracking.qll

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,5 +335,20 @@ abstract class AdditionalTypeTrackingStep extends DataFlow::Node {
335335
/**
336336
* Holds if type-tracking should step from `pred` to `succ`.
337337
*/
338-
abstract predicate step(DataFlow::Node pred, DataFlow::Node succ);
338+
predicate step(DataFlow::Node pred, DataFlow::Node succ) { none() }
339+
340+
/**
341+
* Holds if type-tracking should step from `pred` into the `prop` property of `succ`.
342+
*/
343+
predicate storeStep(DataFlow::Node pred, DataFlow::SourceNode succ, string prop) { none() }
344+
345+
/**
346+
* Holds if type-tracking should step from the `prop` property of `pred` to `succ`.
347+
*/
348+
predicate loadStep(DataFlow::Node pred, DataFlow::Node succ, string prop) { none() }
349+
350+
/**
351+
* Holds if type-tracking should step from the `prop` property of `pred` to the same property in `succ`.
352+
*/
353+
predicate loadStoreStep(DataFlow::Node pred, DataFlow::SourceNode succ, string prop) { none() }
339354
}

javascript/ql/src/semmle/javascript/dataflow/internal/StepSummary.qll

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,15 @@ module StepSummary {
110110
or
111111
basicLoadStep(pred, succ, prop) and
112112
summary = LoadStep(prop)
113+
or
114+
any(AdditionalTypeTrackingStep st).storeStep(pred, succ, prop) and
115+
summary = StoreStep(prop)
116+
or
117+
any(AdditionalTypeTrackingStep st).loadStep(pred, succ, prop) and
118+
summary = LoadStep(prop)
119+
or
120+
any(AdditionalTypeTrackingStep st).loadStoreStep(pred, succ, prop) and
121+
summary = CopyStep(prop)
113122
)
114123
or
115124
any(AdditionalTypeTrackingStep st).step(pred, succ) and

0 commit comments

Comments
 (0)