JS: Summarize functions in type tracking

This commit is contained in:
Asger F
2019-09-09 17:19:05 +01:00
parent 3479f02082
commit ffc69cb61e
4 changed files with 49 additions and 2 deletions

View File

@@ -107,6 +107,20 @@ module StepSummary {
pred = DataFlow::globalAccessPathRootPseudoNode() and
summary = LoadStep(name)
)
or
// Summarize calls with flow directly from a parameter to a return.
exists(DataFlow::ParameterNode param, DataFlow::FunctionNode fun |
param.flowsTo(fun.getAReturn()) and
summary = LevelStep() and
if param = fun.getAParameter() then (
// Step from argument to call site.
argumentPassing(succ, pred, fun.getFunction(), param)
) else (
// Step from captured parameter to local call sites
pred = param and
succ = fun.getAnInvocation()
)
)
}
}