Files
codeql/csharp/ql/test/library-tests/cil/dataflow/DataFlow.ql
Tom Hvitved 6c182564e7 C#: Adjustments to CIL/nullness analyses
- Cache predicates in the same stage using a cached module.
- Introduce `DefUse::defUseVariableUpdate()` and use in `CallableReturns.qll`.
  The updated file `csharp/ql/test/library-tests/cil/dataflow/Nullness.expected`
  demonstrates why this is needed.
- Utilize CIL analysis in `Guards::nonNullValue()`.
- Analyze SSA definitions in `AlwaysNullExpr`, similar to `NonNullExpr`.
2019-03-22 15:11:31 +01:00

17 lines
454 B
Plaintext

import csharp
import semmle.code.csharp.dataflow.DataFlow::DataFlow
class FlowConfig extends Configuration {
FlowConfig() { this = "FlowConfig" }
override predicate isSource(Node source) { source.asExpr() instanceof Literal }
override predicate isSink(Node sink) {
exists(LocalVariable decl | sink.asExpr() = decl.getInitializer())
}
}
from FlowConfig config, Node source, Node sink
where config.hasFlow(source, sink)
select source, sink