Skip to content

Commit 148dccb

Browse files
committed
C#/Go/Java: Instantiate mid-block guards.
1 parent c90ebd1 commit 148dccb

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ private module GuardsInput implements SharedGuards::InputSig<Location, ControlFl
2222

2323
class Expr = CS::Expr;
2424

25+
predicate nodeIsAfterValue(ControlFlowNode node, Expr e, ConditionalSuccessor s) {
26+
node.isAfterValue(e, s)
27+
}
28+
2529
private newtype TConstantValue =
2630
TStringValue(string value) { any(StringLiteral s).getValue() = value }
2731

‎go/ql/lib/semmle/go/controlflow/Guards.qll‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ private module GuardsInput implements
2626

2727
class Expr = G::Expr;
2828

29+
predicate nodeIsAfterValue(CfgImpl::Cfg::ControlFlowNode node, Expr e, ConditionalSuccessor s) {
30+
node.isAfterValue(e, s)
31+
}
32+
2933
private newtype TConstantValue = TStringValue(string s) { s = any(G::Expr e).getStringValue() }
3034

3135
class ConstantValue extends TConstantValue {

‎java/ql/lib/semmle/code/java/controlflow/Guards.qll‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ private module GuardsInput implements SharedGuards::InputSig<Location, ControlFl
8787

8888
class Expr = J::Expr;
8989

90+
predicate nodeIsAfterValue(ControlFlowNode node, Expr e, ConditionalSuccessor s) {
91+
node.isAfterValue(e, s)
92+
}
93+
9094
private newtype TConstantValue =
9195
TCharValue(string c) { any(CharacterLiteral lit).getValue() = c } or
9296
TStringValue(string value) { any(CompileTimeConstantExpr c).getStringValue() = value } or

0 commit comments

Comments
 (0)