Merge pull request #20678 from aschackmull/shared/rename-cfg-reach

Shared/Java: Rename ControlFlowReachability library.
This commit is contained in:
Anders Schack-Mulligen
2025-10-23 10:22:15 +02:00
committed by GitHub
5 changed files with 9 additions and 9 deletions

View File

@@ -3,7 +3,7 @@
*/ */
import csharp import csharp
private import codeql.controlflow.ControlFlow private import codeql.controlflow.ControlFlowReachability
private import semmle.code.csharp.controlflow.BasicBlocks private import semmle.code.csharp.controlflow.BasicBlocks
private import semmle.code.csharp.controlflow.Guards as Guards private import semmle.code.csharp.controlflow.Guards as Guards
private import semmle.code.csharp.ExprOrStmtParent private import semmle.code.csharp.ExprOrStmtParent

View File

@@ -25,7 +25,7 @@ private import semmle.code.csharp.controlflow.Guards::AbstractValues
private import semmle.code.csharp.dataflow.internal.SsaImpl as SsaImpl private import semmle.code.csharp.dataflow.internal.SsaImpl as SsaImpl
private import semmle.code.csharp.frameworks.System private import semmle.code.csharp.frameworks.System
private import semmle.code.csharp.frameworks.Test private import semmle.code.csharp.frameworks.Test
private import semmle.code.csharp.controlflow.ControlFlowReachability as Cf private import semmle.code.csharp.controlflow.ControlFlowReachability
private Expr maybeNullExpr(Expr reason) { private Expr maybeNullExpr(Expr reason) {
G::Internal::nullValue(result) and reason = result G::Internal::nullValue(result) and reason = result
@@ -260,7 +260,7 @@ private predicate defReaches(Ssa::Definition def, ControlFlow::Node cfn) {
) )
} }
private module NullnessConfig implements Cf::ControlFlowReachability::ConfigSig { private module NullnessConfig implements ControlFlowReachability::ConfigSig {
predicate source(ControlFlow::Node node, Ssa::Definition def) { defMaybeNull(def, node, _, _) } predicate source(ControlFlow::Node node, Ssa::Definition def) { defMaybeNull(def, node, _, _) }
predicate sink(ControlFlow::Node node, Ssa::Definition def) { predicate sink(ControlFlow::Node node, Ssa::Definition def) {
@@ -275,7 +275,7 @@ private module NullnessConfig implements Cf::ControlFlowReachability::ConfigSig
predicate uncertainFlow() { none() } predicate uncertainFlow() { none() }
} }
private module NullnessFlow = Cf::ControlFlowReachability::Flow<NullnessConfig>; private module NullnessFlow = ControlFlowReachability::Flow<NullnessConfig>;
predicate maybeNullDeref(Dereference d, Ssa::SourceVariable v, string msg, Element reason) { predicate maybeNullDeref(Dereference d, Ssa::SourceVariable v, string msg, Element reason) {
exists( exists(

View File

@@ -5,7 +5,7 @@ overlay[local?]
module; module;
import java import java
private import codeql.controlflow.ControlFlow private import codeql.controlflow.ControlFlowReachability
private import semmle.code.java.dataflow.SSA as SSA private import semmle.code.java.dataflow.SSA as SSA
private import semmle.code.java.controlflow.Guards as Guards private import semmle.code.java.controlflow.Guards as Guards
@@ -57,4 +57,4 @@ private module ControlFlowInput implements InputSig<Location, ControlFlowNode, B
import Guards::Guards_v3::InternalUtil import Guards::Guards_v3::InternalUtil
} }
module ControlFlow = Make<Location, Cfg, ControlFlowInput>; module ControlFlowReachability = Make<Location, Cfg, ControlFlowInput>;

View File

@@ -16,7 +16,7 @@ private import IntegerGuards
private import NullGuards private import NullGuards
private import semmle.code.java.Collections private import semmle.code.java.Collections
private import semmle.code.java.controlflow.internal.Preconditions private import semmle.code.java.controlflow.internal.Preconditions
private import semmle.code.java.controlflow.ControlFlow as Cf private import semmle.code.java.controlflow.ControlFlowReachability
/** Gets an expression that may be `null`. */ /** Gets an expression that may be `null`. */
Expr nullExpr() { result = nullExpr(_) } Expr nullExpr() { result = nullExpr(_) }
@@ -248,7 +248,7 @@ private predicate impossibleEdge(BasicBlock bb1, BasicBlock bb2) {
) )
} }
private module NullnessConfig implements Cf::ControlFlow::ConfigSig { private module NullnessConfig implements ControlFlowReachability::ConfigSig {
predicate source(ControlFlowNode node, SsaVariable def) { varMaybeNull(def, node, _, _) } predicate source(ControlFlowNode node, SsaVariable def) { varMaybeNull(def, node, _, _) }
predicate sink(ControlFlowNode node, SsaVariable def) { varDereference(def, _) = node } predicate sink(ControlFlowNode node, SsaVariable def) { varDereference(def, _) = node }
@@ -260,7 +260,7 @@ private module NullnessConfig implements Cf::ControlFlow::ConfigSig {
predicate uncertainFlow() { none() } predicate uncertainFlow() { none() }
} }
private module NullnessFlow = Cf::ControlFlow::Flow<NullnessConfig>; private module NullnessFlow = ControlFlowReachability::Flow<NullnessConfig>;
/** /**
* Holds if the dereference of `v` at `va` might be `null`. * Holds if the dereference of `v` at `va` might be `null`.