Skip to content

Commit ed40035

Browse files
committed
C#/Ruby/Rust: Fix bug in adjacentReadPairSameVar.
1 parent 291ea6f commit ed40035

File tree

3 files changed

+3
-3
lines changed
  • csharp/ql/lib/semmle/code/csharp/dataflow/internal
  • ruby/ql/lib/codeql/ruby/dataflow/internal
  • rust/ql/lib/codeql/rust/dataflow/internal

3 files changed

+3
-3
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/SsaImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ private module Cached {
949949
predicate adjacentReadPairSameVar(Definition def, ControlFlow::Node cfn1, ControlFlow::Node cfn2) {
950950
exists(ControlFlow::BasicBlock bb1, int i1, ControlFlow::BasicBlock bb2, int i2 |
951951
cfn1 = bb1.getNode(i1) and
952-
variableReadActual(bb1, i1, _) and
952+
variableReadActual(bb1, i1, def.getSourceVariable()) and
953953
adjacentDefSkipUncertainReads(def, bb1, i1, bb2, i2) and
954954
cfn2 = bb2.getNode(i2)
955955
)

ruby/ql/lib/codeql/ruby/dataflow/internal/SsaImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ private module Cached {
409409
) {
410410
exists(Cfg::BasicBlock bb1, int i1, Cfg::BasicBlock bb2, int i2 |
411411
read1 = bb1.getNode(i1) and
412-
variableReadActual(bb1, i1, _) and
412+
variableReadActual(bb1, i1, def.getSourceVariable()) and
413413
adjacentDefSkipUncertainReads(def, bb1, i1, bb2, i2) and
414414
read2 = bb2.getNode(i2)
415415
)

rust/ql/lib/codeql/rust/dataflow/internal/SsaImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ private module Cached {
330330
predicate adjacentReadPair(Definition def, CfgNode read1, CfgNode read2) {
331331
exists(BasicBlock bb1, int i1, BasicBlock bb2, int i2 |
332332
read1 = bb1.getNode(i1) and
333-
variableReadActual(bb1, i1, _) and
333+
variableReadActual(bb1, i1, def.getSourceVariable()) and
334334
adjacentDefSkipUncertainReads(def, bb1, i1, bb2, i2) and
335335
read2 = bb2.getNode(i2)
336336
)

0 commit comments

Comments
 (0)