Skip to content

Commit dc28ff9

Browse files
committed
C#: Commented out prototype to indicate that x might be read after ++x.
1 parent c28fb12 commit dc28ff9

File tree

1 file changed

+15
-0
lines changed
  • csharp/ql/lib/semmle/code/csharp/dataflow/internal

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,10 +721,25 @@ private module FieldOrPropsImpl {
721721
}
722722
}
723723

724+
// private predicate mutationReadAfterWrite(ControlFlow::BasicBlock bb, int i, Ssa::SourceVariable v) {
725+
// exists(AssignableDefinitions::MutationDefinition def, LocalVariable lv, MutatorOperation mo |
726+
// def.getTarget() = lv and
727+
// mo = def.getMutatorOperation() and
728+
// (
729+
// mo instanceof PreDecrExpr or
730+
// mo instanceof PreIncrExpr
731+
// ) and
732+
// lv = v.getAssignable() and
733+
// // Synthesize that the read happens at the next CFG node (as there is also a corresponding write)
734+
// bb.getNode(i - 1) = def.getExpr().getAControlFlowNode()
735+
// )
736+
// }
724737
private predicate variableReadPseudo(ControlFlow::BasicBlock bb, int i, Ssa::SourceVariable v) {
725738
outRefExitRead(bb, i, v)
726739
or
727740
refReadBeforeWrite(bb, i, v)
741+
// or
742+
// mutationReadAfterWrite(bb, i, v)
728743
}
729744

730745
pragma[noinline]

0 commit comments

Comments
 (0)