Skip to content

Commit 22f9c74

Browse files
committed
C#: Fix caching dependencies.
1 parent f2322ca commit 22f9c74

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

csharp/ql/lib/semmle/code/csharp/controlflow/Guards.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,6 +1424,7 @@ module Internal {
14241424

14251425
cached
14261426
predicate isGuard(Expr e, AbstractValue val) {
1427+
Stages::ControlFlowStage::forceCachingInSameStage() and
14271428
(
14281429
e.getType() instanceof BoolType and
14291430
not e instanceof BoolLiteral and

csharp/ql/lib/semmle/code/csharp/controlflow/internal/PreSsa.qll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ module PreSsa {
8080
}
8181

8282
module SsaInput implements SsaImplCommon::InputSig<Location> {
83+
private import semmle.code.csharp.Caching
84+
8385
class BasicBlock extends PreBasicBlocks::PreBasicBlock {
8486
ControlFlowNode getNode(int i) { result = this.getElement(i) }
8587
}
@@ -130,6 +132,7 @@ module PreSsa {
130132
}
131133

132134
predicate variableWrite(BasicBlock bb, int i, SourceVariable v, boolean certain) {
135+
Stages::ControlFlowStage::forceCachingInSameStage() and
133136
exists(AssignableDefinition def |
134137
definitionAt(def, bb, i, v) and
135138
if def.getTargetAccess().isRefArgument() then certain = false else certain = true

0 commit comments

Comments
 (0)