Merge pull request #1111 from xiemaisi/js/performance-fiddling

Approved by esben-semmle
This commit is contained in:
semmle-qlci
2019-03-14 14:56:26 +00:00
committed by GitHub
5 changed files with 23 additions and 19 deletions

View File

@@ -570,10 +570,24 @@ private predicate reachableFromInput(
callInputStep(f, invk, input, nd, cfg) and
summary = PathSummary::level()
or
exists(DataFlow::Node mid, PathSummary oldSummary, PathSummary newSummary |
exists(DataFlow::Node mid, PathSummary oldSummary |
reachableFromInput(f, invk, input, mid, cfg, oldSummary) and
flowStep(mid, cfg, nd, newSummary) and
summary = oldSummary.append(newSummary)
appendStep(mid, cfg, oldSummary, nd, summary)
)
}
/**
* Holds if there is a step from `pred` to `succ` under `cfg` that can be appended
* to a path represented by `oldSummary` yielding a path represented by `newSummary`.
*/
pragma[noinline]
private predicate appendStep(
DataFlow::Node pred, DataFlow::Configuration cfg, PathSummary oldSummary, DataFlow::Node succ,
PathSummary newSummary
) {
exists(PathSummary stepSummary |
flowStep(pred, cfg, succ, stepSummary) and
newSummary = oldSummary.append(stepSummary)
)
}

View File

@@ -16,7 +16,7 @@ module Electron {
/**
* An instantiation of `BrowserWindow` or `BrowserView`.
*/
abstract private class NewBrowserObject extends BrowserObject, DataFlow::TrackedNode {
abstract private class NewBrowserObject extends BrowserObject, DataFlow::SourceNode {
DataFlow::NewNode self;
NewBrowserObject() { this = self }
@@ -250,10 +250,10 @@ module Electron {
/**
* An additional flow step via an Electron IPC message.
*/
private class IPCAdditionalFlowStep extends DataFlow::Configuration {
IPCAdditionalFlowStep() { this instanceof DataFlow::Configuration }
private class IPCAdditionalFlowStep extends DataFlow::AdditionalFlowStep {
IPCAdditionalFlowStep() { ipcFlowStep(this, _) }
override predicate isAdditionalFlowStep(DataFlow::Node pred, DataFlow::Node succ) {
override predicate step(DataFlow::Node pred, DataFlow::Node succ) {
ipcFlowStep(pred, succ)
}
}