Skip to content

Commit bbf7995

Browse files
committed
C#: Fix caching dependencies.
1 parent 144e34c commit bbf7995

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
@@ -82,6 +82,8 @@ module PreSsa {
8282
}
8383

8484
module SsaInput implements SsaImplCommon::InputSig<Location, PreBasicBlocks::PreBasicBlock> {
85+
private import semmle.code.csharp.Caching
86+
8587
private class ExitBasicBlock extends PreBasicBlocks::PreBasicBlock {
8688
ExitBasicBlock() { scopeLast(_, this.getLastNode(), _) }
8789
}
@@ -124,6 +126,7 @@ module PreSsa {
124126
predicate variableWrite(
125127
PreBasicBlocks::PreBasicBlock bb, int i, SourceVariable v, boolean certain
126128
) {
129+
Stages::ControlFlowStage::forceCachingInSameStage() and
127130
exists(AssignableDefinition def |
128131
definitionAt(def, bb, i, v) and
129132
if def.getTargetAccess().isRefArgument() then certain = false else certain = true

0 commit comments

Comments
 (0)