mirror of
https://github.com/github/codeql.git
synced 2026-04-26 09:15:12 +02:00
JS: Include summary steps in type tracking
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import javascript
|
||||
private import semmle.javascript.dataflow.TypeTracking
|
||||
private import semmle.javascript.internal.CachedStages
|
||||
private import sharedlib.SummaryTypeTracker as SummaryTypeTracker
|
||||
private import FlowSteps
|
||||
|
||||
cached
|
||||
@@ -46,6 +47,12 @@ private module Cached {
|
||||
LoadStoreStep(PropertyName fromProp, PropertyName toProp) {
|
||||
SharedTypeTrackingStep::loadStoreStep(_, _, fromProp, toProp)
|
||||
or
|
||||
exists(DataFlow::ContentSet loadContent, DataFlow::ContentSet storeContent |
|
||||
SummaryTypeTracker::basicLoadStoreStep(_, _, loadContent, storeContent) and
|
||||
fromProp = loadContent.asPropertyName() and
|
||||
toProp = storeContent.asPropertyName()
|
||||
)
|
||||
or
|
||||
summarizedLoadStoreStep(_, _, fromProp, toProp)
|
||||
} or
|
||||
WithoutPropStep(PropertySet props) { SharedTypeTrackingStep::withoutPropStep(_, _, props) }
|
||||
@@ -205,6 +212,21 @@ private module Cached {
|
||||
succ = getACallbackSource(parameter).getParameter(i) and
|
||||
summary = ReturnStep()
|
||||
)
|
||||
or
|
||||
SummaryTypeTracker::levelStepNoCall(pred, succ) and summary = LevelStep()
|
||||
or
|
||||
exists(DataFlow::ContentSet content |
|
||||
SummaryTypeTracker::basicLoadStep(pred, succ, content) and
|
||||
summary = LoadStep(content.asPropertyName())
|
||||
or
|
||||
SummaryTypeTracker::basicStoreStep(pred, succ, content) and
|
||||
summary = StoreStep(content.asPropertyName())
|
||||
)
|
||||
or
|
||||
exists(DataFlow::ContentSet loadContent, DataFlow::ContentSet storeContent |
|
||||
SummaryTypeTracker::basicLoadStoreStep(pred, succ, loadContent, storeContent) and
|
||||
summary = LoadStoreStep(loadContent.asPropertyName(), storeContent.asPropertyName())
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user