C#: Fix bad join-orders following stats update

This commit is contained in:
Tom Hvitved
2020-11-19 10:42:13 +01:00
parent 866c98bbd9
commit 02ec325380
2 changed files with 8 additions and 6 deletions

View File

@@ -165,14 +165,16 @@ module DefUse {
(
exists(int last | last = max(refRank(bb, _, v, _)) | defReachesRank(bb, vu, last, v))
or
exists(BasicBlock pred |
pred = bb.getAPredecessor() and
defReachesEndOfBlock(pred, vu, v) and
not exists(refRank(bb, _, v, Write()))
)
defReachesStartOfBlock(bb, vu, v) and
not exists(refRank(bb, _, v, Write()))
)
}
pragma[noinline]
private predicate defReachesStartOfBlock(BasicBlock bb, VariableUpdate vu, StackVariable v) {
defReachesEndOfBlock(bb.getAPredecessor(), vu, v)
}
/**
* Holds if the variable update `vu` of stack variable `v` reaches `read` in the
* same basic block without crossing another update of `v`.

View File

@@ -1130,7 +1130,7 @@ module Ssa {
exists(Expr mid | reachesDelegateCall(mid) | delegateFlowStep(e, mid))
}
pragma[noinline]
pragma[nomagic]
private predicate delegateFlowStepReaches(Expr pred, Expr succ) {
delegateFlowStep(pred, succ) and
reachesDelegateCall(succ)