Python: Remove omittable exists variables

This commit is contained in:
Tony Torralba
2022-12-21 16:34:22 +01:00
parent 3b6dae41cd
commit d87c8c75d6
30 changed files with 190 additions and 225 deletions

View File

@@ -29,7 +29,7 @@ class MaximalFlowsConfig extends DataFlow::Configuration {
not node instanceof DataFlow::PostUpdateNode and
// not node.asExpr() instanceof FunctionExpr and
// not node.asExpr() instanceof ClassExpr and
not exists(DataFlow::Node pred | DataFlow::localFlowStep(pred, node))
not DataFlow::localFlowStep(_, node)
}
override predicate isSink(DataFlow::Node node) {
@@ -37,6 +37,6 @@ class MaximalFlowsConfig extends DataFlow::Configuration {
not any(CallNode c).getArg(_) = node.asCfgNode() and
not node instanceof DataFlow::ArgumentNode and
not node.asCfgNode().(NameNode).getId().matches("SINK%") and
not exists(DataFlow::Node succ | DataFlow::localFlowStep(node, succ))
not DataFlow::localFlowStep(node, _)
}
}

View File

@@ -9,9 +9,7 @@ class CaptureTest extends InlineExpectationsTest {
override string getARelevantTag() { result = "captured" }
override predicate hasActualResult(Location location, string element, string tag, string value) {
exists(DataFlow::Node source, DataFlow::Node sink |
exists(TestConfiguration cfg | cfg.hasFlow(source, sink))
|
exists(DataFlow::Node sink | exists(TestConfiguration cfg | cfg.hasFlowTo(sink)) |
location = sink.getLocation() and
tag = "captured" and
value = "" and