JavaScript: Make Configuration::isLive nullary.

This makes it more obvious to the evaluator that it is a good predicate to pick as a sentinel, and in practice we mostly just have one configuration in scope anyway.
This commit is contained in:
Max Schaefer
2019-10-18 16:49:21 +01:00
parent 6964945c74
commit 98e0932de5

View File

@@ -454,6 +454,7 @@ private class FlowStepThroughImport extends AdditionalFlowStep, DataFlow::ValueN
private predicate basicFlowStep(
DataFlow::Node pred, DataFlow::Node succ, PathSummary summary, DataFlow::Configuration cfg
) {
isLive() and
isRelevantForward(pred, cfg) and
(
// Local flow
@@ -933,17 +934,17 @@ private predicate onPath(DataFlow::Node nd, DataFlow::Configuration cfg, PathSum
}
/**
* Holds if `cfg` has at least one source and at least one sink.
* Holds if there is a configuration that has at least one source and at least one sink.
*/
pragma[noinline]
private predicate isLive(DataFlow::Configuration cfg) { isSource(_, cfg, _) and isSink(_, cfg, _) }
private predicate isLive() { exists(DataFlow::Configuration cfg | isSource(_, cfg, _) and isSink(_, cfg, _)) }
/**
* A data flow node on an inter-procedural path from a source.
*/
private newtype TPathNode =
MkPathNode(DataFlow::Node nd, DataFlow::Configuration cfg, PathSummary summary) {
isLive(cfg) and
isLive() and
onPath(nd, cfg, summary)
}