mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
- 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`.
17 lines
454 B
Plaintext
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
|