diff --git a/csharp/ql/lib/semmle/code/csharp/controlflow/ControlFlowReachability.qll b/csharp/ql/lib/semmle/code/csharp/controlflow/ControlFlowReachability.qll index 33d96a61fc7..4ec4dad9e1b 100644 --- a/csharp/ql/lib/semmle/code/csharp/controlflow/ControlFlowReachability.qll +++ b/csharp/ql/lib/semmle/code/csharp/controlflow/ControlFlowReachability.qll @@ -26,17 +26,7 @@ private module ControlFlowInput implements InputSig; class GuardValue = GuardsImpl::GuardValue; private module LogicInput implements GuardsImpl::LogicInputSig { - class SsaDefinition extends Ssa::Definition { - Expr getARead() { super.getARead() = result } - } - - class SsaExplicitWrite extends SsaDefinition instanceof Ssa::ExplicitDefinition { - Expr getValue() { result = super.getADefinition().getSource() } - } - - class SsaPhiDefinition extends SsaDefinition instanceof Ssa::PhiNode { - predicate hasInputFromBlock(SsaDefinition inp, BasicBlock bb) { - super.hasInputFromBlock(inp, bb) - } - } - - class SsaParameterInit extends SsaDefinition instanceof Ssa::ParameterDefinition { - Parameter getParameter() { result = super.getParameter() } - } + import Ssa predicate additionalNullCheck(GuardsImpl::PreGuard guard, GuardValue val, Expr e, boolean isNull) { // Comparison with a non-`null` value, for example `x?.Length > 0` diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll index 63205e52ae5..6cd4fe31113 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll @@ -250,9 +250,9 @@ private predicate defReaches(Ssa::Definition def, ControlFlowNode cfn) { } private module NullnessConfig implements ControlFlowReachability::ConfigSig { - predicate source(ControlFlowNode node, Ssa::Definition def) { defMaybeNull(def, node, _, _) } + predicate source(ControlFlowNode node, SsaDefinition def) { defMaybeNull(def, node, _, _) } - predicate sink(ControlFlowNode node, Ssa::Definition def) { + predicate sink(ControlFlowNode node, SsaDefinition def) { exists(Dereference d | dereferenceAt(node, def, d) and not d instanceof NonNullExpr