File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
csharp/ql/lib/semmle/code/csharp/dataflow/internal Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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+ // }
724737private 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
730745pragma [ noinline]
You can’t perform that action at this time.
0 commit comments