зеркало из https://github.com/github/codeql.git
add a new LoadStoreStep as a StepSummary for TypeTracking
This commit is contained in:
Родитель
e7fd97e72b
Коммит
9a78d38df0
|
@ -44,7 +44,7 @@ private newtype TTypeTracker = MkTypeTracker(Boolean hasCall, OptionalPropertyNa
|
|||
*/
|
||||
class TypeTracker extends TTypeTracker {
|
||||
Boolean hasCall;
|
||||
string prop;
|
||||
OptionalPropertyName prop;
|
||||
|
||||
TypeTracker() { this = MkTypeTracker(hasCall, prop) }
|
||||
|
||||
|
@ -53,6 +53,8 @@ class TypeTracker extends TTypeTracker {
|
|||
TypeTracker append(StepSummary step) {
|
||||
step = LevelStep() and result = this
|
||||
or
|
||||
step = LoadStoreStep(prop) and result = this
|
||||
or
|
||||
step = CallStep() and result = MkTypeTracker(true, prop)
|
||||
or
|
||||
step = ReturnStep() and hasCall = false and result = this
|
||||
|
@ -211,6 +213,8 @@ class TypeBackTracker extends TTypeBackTracker {
|
|||
TypeBackTracker prepend(StepSummary step) {
|
||||
step = LevelStep() and result = this
|
||||
or
|
||||
step = LoadStoreStep(prop) and result = this
|
||||
or
|
||||
step = CallStep() and hasReturn = false and result = this
|
||||
or
|
||||
step = ReturnStep() and result = MkTypeBackTracker(true, prop)
|
||||
|
|
|
@ -34,7 +34,8 @@ newtype TStepSummary =
|
|||
CallStep() or
|
||||
ReturnStep() or
|
||||
StoreStep(PropertyName prop) or
|
||||
LoadStep(PropertyName prop)
|
||||
LoadStep(PropertyName prop) or
|
||||
LoadStoreStep(PropertyName prop)
|
||||
|
||||
/**
|
||||
* INTERNAL: Use `TypeTracker` or `TypeBackTracker` instead.
|
||||
|
@ -53,6 +54,8 @@ class StepSummary extends TStepSummary {
|
|||
exists(string prop | this = StoreStep(prop) | result = "store " + prop)
|
||||
or
|
||||
exists(string prop | this = LoadStep(prop) | result = "load " + prop)
|
||||
or
|
||||
exists(string prop | this = LoadStoreStep(prop) | result = "in " + prop)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче