From dbd99df85b743491a0db88f89e64f89e5c9c8c6a Mon Sep 17 00:00:00 2001 From: Anders Schack-Mulligen Date: Tue, 1 Apr 2025 10:03:20 +0200 Subject: [PATCH] C#: Update PreSSA to reference the new use-use predicates. --- .../semmle/code/csharp/controlflow/internal/PreSsa.qll | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/controlflow/internal/PreSsa.qll b/csharp/ql/lib/semmle/code/csharp/controlflow/internal/PreSsa.qll index 184317b07bda..6507bbbe04bf 100644 --- a/csharp/ql/lib/semmle/code/csharp/controlflow/internal/PreSsa.qll +++ b/csharp/ql/lib/semmle/code/csharp/controlflow/internal/PreSsa.qll @@ -175,10 +175,9 @@ module PreSsa { } final AssignableRead getAFirstRead() { - exists(SsaInput::BasicBlock bb1, int i1, SsaInput::BasicBlock bb2, int i2 | - this.definesAt(_, bb1, i1) and - SsaImpl::adjacentDefRead(this, bb1, i1, bb2, i2) and - result = bb2.getElement(i2) + exists(SsaInput::BasicBlock bb, int i | + SsaImpl::firstUse(this, bb, i, true) and + result = bb.getElement(i) ) } @@ -216,8 +215,7 @@ module PreSsa { predicate adjacentReadPairSameVar(AssignableRead read1, AssignableRead read2) { exists(SsaInput::BasicBlock bb1, int i1, SsaInput::BasicBlock bb2, int i2 | read1 = bb1.getElement(i1) and - SsaInput::variableRead(bb1, i1, _, true) and - SsaImpl::adjacentDefRead(_, bb1, i1, bb2, i2) and + SsaImpl::adjacentUseUse(bb1, i1, bb2, i2, _, true) and read2 = bb2.getElement(i2) ) }