From fb438bf5127bd058de75f35e8d31897c84c5a08c Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Thu, 23 Apr 2026 14:25:43 +0200 Subject: [PATCH] C#: Remove references to getAFirstReadAtNode. --- csharp/ql/lib/semmle/code/csharp/Assignable.qll | 6 +----- csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/Assignable.qll b/csharp/ql/lib/semmle/code/csharp/Assignable.qll index d2df0a5a05e..a86e9d6de5c 100644 --- a/csharp/ql/lib/semmle/code/csharp/Assignable.qll +++ b/csharp/ql/lib/semmle/code/csharp/Assignable.qll @@ -500,11 +500,7 @@ class AssignableDefinition extends TAssignableDefinition { */ pragma[nomagic] AssignableRead getAFirstRead() { - exists(ControlFlowNode cfn | cfn = result.getControlFlowNode() | - exists(Ssa::ExplicitDefinition def | result = def.getAFirstReadAtNode(cfn) | - this = def.getADefinition() - ) - ) + exists(Ssa::ExplicitDefinition def | result = def.getAFirstRead() | this = def.getADefinition()) } /** Gets a textual representation of this assignable definition. */ diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll index 6cd4fe31113..693a91a3ce5 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/Nullness.qll @@ -241,7 +241,7 @@ private Ssa::Definition getAnUltimateDefinition(Ssa::Definition def) { * exception. */ private predicate defReaches(Ssa::Definition def, ControlFlowNode cfn) { - exists(def.getAFirstReadAtNode(cfn)) + def.getAFirstRead().getControlFlowNode() = cfn or exists(ControlFlowNode mid | defReaches(def, mid) | SsaImpl::adjacentReadPairSameVar(_, mid, cfn) and