GeezerVison is showing github.com — Merge pull request #14983 from aschackmull/dataflow/deprecate-old-api · github/codeql@64eb4ff
File treeExpand file treeCollapse file tree Open diff view settings test/library-tests/dataflow/recursion
lib/semmle/code/csharp/dataflow/internal src/experimental/dataflow/flowsources
go/ql/lib/semmle/go/dataflow/internal java/ql/lib/semmle/code/java/dataflow/internal lib/semmle/python/dataflow/new/internal
ruby/ql/lib/codeql/ruby/dataflow/internal swift/ql/lib/codeql/swift/dataflow/internal
Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl1.qll +19-17Lines changed: 19 additions & 17 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,6 +14,8 @@ import FlowStateString | 14 | 14 | private import codeql.util.Unit | 15 | 15 |
| 16 | 16 | /** | | 17 | + * DEPRECATED: Use `Global` and `GlobalWithState` instead. | | 18 | + * | 17 | 19 | * A configuration of interprocedural data flow analysis. This defines | 18 | 20 | * sources, sinks, and any other configurable aspect of the analysis. Each | 19 | 21 | * use of the global data flow library must define its own unique extension | @@ -48,7 +50,7 @@ private import codeql.util.Unit | 48 | 50 | * should instead depend on a `DataFlow2::Configuration`, a | 49 | 51 | * `DataFlow3::Configuration`, or a `DataFlow4::Configuration`. | 50 | 52 | */ | 51 | | -abstract class Configuration extends string { | | 53 | +abstract deprecated class Configuration extends string { | 52 | 54 | bindingset[this] | 53 | 55 | Configuration() { any() } | 54 | 56 |
| @@ -189,7 +191,7 @@ abstract class Configuration extends string { | 189 | 191 | * Good performance cannot be guaranteed in the presence of such recursion, so | 190 | 192 | * it should be replaced by using more than one copy of the data flow library. | 191 | 193 | */ | 192 | | -abstract private class ConfigurationRecursionPrevention extends Configuration { | | 194 | +abstract deprecated private class ConfigurationRecursionPrevention extends Configuration { | 193 | 195 | bindingset[this] | 194 | 196 | ConfigurationRecursionPrevention() { any() } | 195 | 197 |
| @@ -210,7 +212,7 @@ abstract private class ConfigurationRecursionPrevention extends Configuration { | 210 | 212 | } | 211 | 213 | } | 212 | 214 |
| 213 | | -private FlowState relevantState(Configuration config) { | | 215 | +deprecated private FlowState relevantState(Configuration config) { | 214 | 216 | config.isSource(_, result) or | 215 | 217 | config.isSink(_, result) or | 216 | 218 | config.isBarrier(_, result) or | @@ -219,17 +221,17 @@ private FlowState relevantState(Configuration config) { | 219 | 221 | } | 220 | 222 |
| 221 | 223 | private newtype TConfigState = | 222 | | - TMkConfigState(Configuration config, FlowState state) { | | 224 | + deprecated TMkConfigState(Configuration config, FlowState state) { | 223 | 225 | state = relevantState(config) or state instanceof FlowStateEmpty | 224 | 226 | } | 225 | 227 |
| 226 | | -private Configuration getConfig(TConfigState state) { state = TMkConfigState(result, _) } | | 228 | +deprecated private Configuration getConfig(TConfigState state) { state = TMkConfigState(result, _) } | 227 | 229 |
| 228 | | -private FlowState getState(TConfigState state) { state = TMkConfigState(_, result) } | | 230 | +deprecated private FlowState getState(TConfigState state) { state = TMkConfigState(_, result) } | 229 | 231 |
| 230 | | -private predicate singleConfiguration() { 1 = strictcount(Configuration c) } | | 232 | +deprecated private predicate singleConfiguration() { 1 = strictcount(Configuration c) } | 231 | 233 |
| 232 | | -private module Config implements FullStateConfigSig { | | 234 | +deprecated private module Config implements FullStateConfigSig { | 233 | 235 | class FlowState = TConfigState; | 234 | 236 |
| 235 | 237 | predicate isSource(Node source, FlowState state) { | @@ -296,13 +298,13 @@ private module Config implements FullStateConfigSig { | 296 | 298 | predicate includeHiddenNodes() { any(Configuration config).includeHiddenNodes() } | 297 | 299 | } | 298 | 300 |
| 299 | | -private import Impl<Config> as I | | 301 | +deprecated private import Impl<Config> as I | 300 | 302 |
| 301 | 303 | /** | 302 | 304 | * A `Node` augmented with a call context (except for sinks), an access path, and a configuration. | 303 | 305 | * Only those `PathNode`s that are reachable from a source, and which can reach a sink, are generated. | 304 | 306 | */ | 305 | | -class PathNode instanceof I::PathNode { | | 307 | +deprecated class PathNode instanceof I::PathNode { | 306 | 308 | /** Gets a textual representation of this element. */ | 307 | 309 | final string toString() { result = super.toString() } | 308 | 310 |
| @@ -329,10 +331,10 @@ class PathNode instanceof I::PathNode { | 329 | 331 | final Node getNode() { result = super.getNode() } | 330 | 332 |
| 331 | 333 | /** Gets the `FlowState` of this node. */ | 332 | | - final FlowState getState() { result = getState(super.getState()) } | | 334 | + deprecated final FlowState getState() { result = getState(super.getState()) } | 333 | 335 |
| 334 | 336 | /** Gets the associated configuration. */ | 335 | | - final Configuration getConfiguration() { result = getConfig(super.getState()) } | | 337 | + deprecated final Configuration getConfiguration() { result = getConfig(super.getState()) } | 336 | 338 |
| 337 | 339 | /** Gets a successor of this node, if any. */ | 338 | 340 | final PathNode getASuccessor() { result = super.getASuccessor() } | @@ -347,20 +349,20 @@ class PathNode instanceof I::PathNode { | 347 | 349 | final predicate isSinkGroup(string group) { super.isSinkGroup(group) } | 348 | 350 | } | 349 | 351 |
| 350 | | -module PathGraph = I::PathGraph; | | 352 | +deprecated module PathGraph = I::PathGraph; | 351 | 353 |
| 352 | | -private predicate hasFlow(Node source, Node sink, Configuration config) { | | 354 | +deprecated private predicate hasFlow(Node source, Node sink, Configuration config) { | 353 | 355 | exists(PathNode source0, PathNode sink0 | | 354 | 356 | hasFlowPath(source0, sink0, config) and | 355 | 357 | source0.getNode() = source and | 356 | 358 | sink0.getNode() = sink | 357 | 359 | ) | 358 | 360 | } | 359 | 361 |
| 360 | | -private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) { | | 362 | +deprecated private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) { | 361 | 363 | I::flowPath(source, sink) and source.getConfiguration() = config | 362 | 364 | } | 363 | 365 |
| 364 | | -private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) } | | 366 | +deprecated private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) } | 365 | 367 |
| 366 | | -predicate flowsTo = hasFlow/3; | | 368 | +deprecated predicate flowsTo = hasFlow/3; |
Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl2.qll +19-17Lines changed: 19 additions & 17 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,6 +14,8 @@ import FlowStateString | 14 | 14 | private import codeql.util.Unit | 15 | 15 |
| 16 | 16 | /** | | 17 | + * DEPRECATED: Use `Global` and `GlobalWithState` instead. | | 18 | + * | 17 | 19 | * A configuration of interprocedural data flow analysis. This defines | 18 | 20 | * sources, sinks, and any other configurable aspect of the analysis. Each | 19 | 21 | * use of the global data flow library must define its own unique extension | @@ -48,7 +50,7 @@ private import codeql.util.Unit | 48 | 50 | * should instead depend on a `DataFlow2::Configuration`, a | 49 | 51 | * `DataFlow3::Configuration`, or a `DataFlow4::Configuration`. | 50 | 52 | */ | 51 | | -abstract class Configuration extends string { | | 53 | +abstract deprecated class Configuration extends string { | 52 | 54 | bindingset[this] | 53 | 55 | Configuration() { any() } | 54 | 56 |
| @@ -189,7 +191,7 @@ abstract class Configuration extends string { | 189 | 191 | * Good performance cannot be guaranteed in the presence of such recursion, so | 190 | 192 | * it should be replaced by using more than one copy of the data flow library. | 191 | 193 | */ | 192 | | -abstract private class ConfigurationRecursionPrevention extends Configuration { | | 194 | +abstract deprecated private class ConfigurationRecursionPrevention extends Configuration { | 193 | 195 | bindingset[this] | 194 | 196 | ConfigurationRecursionPrevention() { any() } | 195 | 197 |
| @@ -210,7 +212,7 @@ abstract private class ConfigurationRecursionPrevention extends Configuration { | 210 | 212 | } | 211 | 213 | } | 212 | 214 |
| 213 | | -private FlowState relevantState(Configuration config) { | | 215 | +deprecated private FlowState relevantState(Configuration config) { | 214 | 216 | config.isSource(_, result) or | 215 | 217 | config.isSink(_, result) or | 216 | 218 | config.isBarrier(_, result) or | @@ -219,17 +221,17 @@ private FlowState relevantState(Configuration config) { | 219 | 221 | } | 220 | 222 |
| 221 | 223 | private newtype TConfigState = | 222 | | - TMkConfigState(Configuration config, FlowState state) { | | 224 | + deprecated TMkConfigState(Configuration config, FlowState state) { | 223 | 225 | state = relevantState(config) or state instanceof FlowStateEmpty | 224 | 226 | } | 225 | 227 |
| 226 | | -private Configuration getConfig(TConfigState state) { state = TMkConfigState(result, _) } | | 228 | +deprecated private Configuration getConfig(TConfigState state) { state = TMkConfigState(result, _) } | 227 | 229 |
| 228 | | -private FlowState getState(TConfigState state) { state = TMkConfigState(_, result) } | | 230 | +deprecated private FlowState getState(TConfigState state) { state = TMkConfigState(_, result) } | 229 | 231 |
| 230 | | -private predicate singleConfiguration() { 1 = strictcount(Configuration c) } | | 232 | +deprecated private predicate singleConfiguration() { 1 = strictcount(Configuration c) } | 231 | 233 |
| 232 | | -private module Config implements FullStateConfigSig { | | 234 | +deprecated private module Config implements FullStateConfigSig { | 233 | 235 | class FlowState = TConfigState; | 234 | 236 |
| 235 | 237 | predicate isSource(Node source, FlowState state) { | @@ -296,13 +298,13 @@ private module Config implements FullStateConfigSig { | 296 | 298 | predicate includeHiddenNodes() { any(Configuration config).includeHiddenNodes() } | 297 | 299 | } | 298 | 300 |
| 299 | | -private import Impl<Config> as I | | 301 | +deprecated private import Impl<Config> as I | 300 | 302 |
| 301 | 303 | /** | 302 | 304 | * A `Node` augmented with a call context (except for sinks), an access path, and a configuration. | 303 | 305 | * Only those `PathNode`s that are reachable from a source, and which can reach a sink, are generated. | 304 | 306 | */ | 305 | | -class PathNode instanceof I::PathNode { | | 307 | +deprecated class PathNode instanceof I::PathNode { | 306 | 308 | /** Gets a textual representation of this element. */ | 307 | 309 | final string toString() { result = super.toString() } | 308 | 310 |
| @@ -329,10 +331,10 @@ class PathNode instanceof I::PathNode { | 329 | 331 | final Node getNode() { result = super.getNode() } | 330 | 332 |
| 331 | 333 | /** Gets the `FlowState` of this node. */ | 332 | | - final FlowState getState() { result = getState(super.getState()) } | | 334 | + deprecated final FlowState getState() { result = getState(super.getState()) } | 333 | 335 |
| 334 | 336 | /** Gets the associated configuration. */ | 335 | | - final Configuration getConfiguration() { result = getConfig(super.getState()) } | | 337 | + deprecated final Configuration getConfiguration() { result = getConfig(super.getState()) } | 336 | 338 |
| 337 | 339 | /** Gets a successor of this node, if any. */ | 338 | 340 | final PathNode getASuccessor() { result = super.getASuccessor() } | @@ -347,20 +349,20 @@ class PathNode instanceof I::PathNode { | 347 | 349 | final predicate isSinkGroup(string group) { super.isSinkGroup(group) } | 348 | 350 | } | 349 | 351 |
| 350 | | -module PathGraph = I::PathGraph; | | 352 | +deprecated module PathGraph = I::PathGraph; | 351 | 353 |
| 352 | | -private predicate hasFlow(Node source, Node sink, Configuration config) { | | 354 | +deprecated private predicate hasFlow(Node source, Node sink, Configuration config) { | 353 | 355 | exists(PathNode source0, PathNode sink0 | | 354 | 356 | hasFlowPath(source0, sink0, config) and | 355 | 357 | source0.getNode() = source and | 356 | 358 | sink0.getNode() = sink | 357 | 359 | ) | 358 | 360 | } | 359 | 361 |
| 360 | | -private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) { | | 362 | +deprecated private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) { | 361 | 363 | I::flowPath(source, sink) and source.getConfiguration() = config | 362 | 364 | } | 363 | 365 |
| 364 | | -private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) } | | 366 | +deprecated private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) } | 365 | 367 |
| 366 | | -predicate flowsTo = hasFlow/3; | | 368 | +deprecated predicate flowsTo = hasFlow/3; |
Collapse file Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/dataflow/internal/DataFlowImpl3.qll +19-17Lines changed: 19 additions & 17 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -14,6 +14,8 @@ import FlowStateString | 14 | 14 | private import codeql.util.Unit | 15 | 15 |
| 16 | 16 | /** | | 17 | + * DEPRECATED: Use `Global` and `GlobalWithState` instead. | | 18 | + * | 17 | 19 | * A configuration of interprocedural data flow analysis. This defines | 18 | 20 | * sources, sinks, and any other configurable aspect of the analysis. Each | 19 | 21 | * use of the global data flow library must define its own unique extension | @@ -48,7 +50,7 @@ private import codeql.util.Unit | 48 | 50 | * should instead depend on a `DataFlow2::Configuration`, a | 49 | 51 | * `DataFlow3::Configuration`, or a `DataFlow4::Configuration`. | 50 | 52 | */ | 51 | | -abstract class Configuration extends string { | | 53 | +abstract deprecated class Configuration extends string { | 52 | 54 | bindingset[this] | 53 | 55 | Configuration() { any() } | 54 | 56 |
| @@ -189,7 +191,7 @@ abstract class Configuration extends string { | 189 | 191 | * Good performance cannot be guaranteed in the presence of such recursion, so | 190 | 192 | * it should be replaced by using more than one copy of the data flow library. | 191 | 193 | */ | 192 | | -abstract private class ConfigurationRecursionPrevention extends Configuration { | | 194 | +abstract deprecated private class ConfigurationRecursionPrevention extends Configuration { | 193 | 195 | bindingset[this] | 194 | 196 | ConfigurationRecursionPrevention() { any() } | 195 | 197 |
| @@ -210,7 +212,7 @@ abstract private class ConfigurationRecursionPrevention extends Configuration { | 210 | 212 | } | 211 | 213 | } | 212 | 214 |
| 213 | | -private FlowState relevantState(Configuration config) { | | 215 | +deprecated private FlowState relevantState(Configuration config) { | 214 | 216 | config.isSource(_, result) or | 215 | 217 | config.isSink(_, result) or | 216 | 218 | config.isBarrier(_, result) or | @@ -219,17 +221,17 @@ private FlowState relevantState(Configuration config) { | 219 | 221 | } | 220 | 222 |
| 221 | 223 | private newtype TConfigState = | 222 | | - TMkConfigState(Configuration config, FlowState state) { | | 224 | + deprecated TMkConfigState(Configuration config, FlowState state) { | 223 | 225 | state = relevantState(config) or state instanceof FlowStateEmpty | 224 | 226 | } | 225 | 227 |
| 226 | | -private Configuration getConfig(TConfigState state) { state = TMkConfigState(result, _) } | | 228 | +deprecated private Configuration getConfig(TConfigState state) { state = TMkConfigState(result, _) } | 227 | 229 |
| 228 | | -private FlowState getState(TConfigState state) { state = TMkConfigState(_, result) } | | 230 | +deprecated private FlowState getState(TConfigState state) { state = TMkConfigState(_, result) } | 229 | 231 |
| 230 | | -private predicate singleConfiguration() { 1 = strictcount(Configuration c) } | | 232 | +deprecated private predicate singleConfiguration() { 1 = strictcount(Configuration c) } | 231 | 233 |
| 232 | | -private module Config implements FullStateConfigSig { | | 234 | +deprecated private module Config implements FullStateConfigSig { | 233 | 235 | class FlowState = TConfigState; | 234 | 236 |
| 235 | 237 | predicate isSource(Node source, FlowState state) { | @@ -296,13 +298,13 @@ private module Config implements FullStateConfigSig { | 296 | 298 | predicate includeHiddenNodes() { any(Configuration config).includeHiddenNodes() } | 297 | 299 | } | 298 | 300 |
| 299 | | -private import Impl<Config> as I | | 301 | +deprecated private import Impl<Config> as I | 300 | 302 |
| 301 | 303 | /** | 302 | 304 | * A `Node` augmented with a call context (except for sinks), an access path, and a configuration. | 303 | 305 | * Only those `PathNode`s that are reachable from a source, and which can reach a sink, are generated. | 304 | 306 | */ | 305 | | -class PathNode instanceof I::PathNode { | | 307 | +deprecated class PathNode instanceof I::PathNode { | 306 | 308 | /** Gets a textual representation of this element. */ | 307 | 309 | final string toString() { result = super.toString() } | 308 | 310 |
| @@ -329,10 +331,10 @@ class PathNode instanceof I::PathNode { | 329 | 331 | final Node getNode() { result = super.getNode() } | 330 | 332 |
| 331 | 333 | /** Gets the `FlowState` of this node. */ | 332 | | - final FlowState getState() { result = getState(super.getState()) } | | 334 | + deprecated final FlowState getState() { result = getState(super.getState()) } | 333 | 335 |
| 334 | 336 | /** Gets the associated configuration. */ | 335 | | - final Configuration getConfiguration() { result = getConfig(super.getState()) } | | 337 | + deprecated final Configuration getConfiguration() { result = getConfig(super.getState()) } | 336 | 338 |
| 337 | 339 | /** Gets a successor of this node, if any. */ | 338 | 340 | final PathNode getASuccessor() { result = super.getASuccessor() } | @@ -347,20 +349,20 @@ class PathNode instanceof I::PathNode { | 347 | 349 | final predicate isSinkGroup(string group) { super.isSinkGroup(group) } | 348 | 350 | } | 349 | 351 |
| 350 | | -module PathGraph = I::PathGraph; | | 352 | +deprecated module PathGraph = I::PathGraph; | 351 | 353 |
| 352 | | -private predicate hasFlow(Node source, Node sink, Configuration config) { | | 354 | +deprecated private predicate hasFlow(Node source, Node sink, Configuration config) { | 353 | 355 | exists(PathNode source0, PathNode sink0 | | 354 | 356 | hasFlowPath(source0, sink0, config) and | 355 | 357 | source0.getNode() = source and | 356 | 358 | sink0.getNode() = sink | 357 | 359 | ) | 358 | 360 | } | 359 | 361 |
| 360 | | -private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) { | | 362 | +deprecated private predicate hasFlowPath(PathNode source, PathNode sink, Configuration config) { | 361 | 363 | I::flowPath(source, sink) and source.getConfiguration() = config | 362 | 364 | } | 363 | 365 |
| 364 | | -private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) } | | 366 | +deprecated private predicate hasFlowTo(Node sink, Configuration config) { hasFlow(_, sink, config) } | 365 | 367 |
| 366 | | -predicate flowsTo = hasFlow/3; | | 368 | +deprecated predicate flowsTo = hasFlow/3; |
|