Skip to content

Commit 1d654d1

Browse files
committed
C#: Restrict refReadBeforeWrite
1 parent 1739673 commit 1d654d1

File tree

1 file changed

+2
-1
lines changed
  • csharp/ql/lib/semmle/code/csharp/dataflow/internal

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ private module SourceVariableImpl {
171171
def.getTarget() = lv and
172172
lv.isRef() and
173173
lv = v.getAssignable() and
174-
bb.getNode(i) = def.getAControlFlowNode()
174+
bb.getNode(i) = def.getAControlFlowNode() and
175+
not def.getAssignment() instanceof LocalVariableDeclAndInitExpr
175176
)
176177
}
177178

0 commit comments

Comments
 (0)