Skip to content

Commit b94c498

Browse files
committed
C#: Reduce reliance on CFG nodes in DataFlow::Node.
1 parent d4a0846 commit b94c498

File tree

4 files changed

+123
-169
lines changed

4 files changed

+123
-169
lines changed

csharp/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ private module Input implements InputSig<Location, CsharpDataFlow> {
7171
)
7272
or
7373
exists(ControlFlow::Nodes::ElementNode cfn, ControlFlow::Nodes::Split split |
74-
exists(arg.asExprAtNode(cfn))
74+
arg.asExpr().getControlFlowNode() = cfn
7575
|
7676
split = cfn.getASplit() and
7777
not split = call.getControlFlowNode().getASplit()

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,7 @@ class GuardedDataFlowNode extends DataFlow::ExprNode {
784784
private AccessOrCallExpr sub0;
785785
private GuardValue v0;
786786

787-
GuardedDataFlowNode() {
788-
exists(ControlFlow::Nodes::ElementNode cfn | exists(this.getExprAtNode(cfn)) |
789-
g.controlsNode(cfn, sub0, v0)
790-
)
791-
}
787+
GuardedDataFlowNode() { g.controlsNode(this.getExpr().getControlFlowNode(), sub0, v0) }
792788

793789
/**
794790
* Gets an expression that guards this data flow node. That is, this data flow

0 commit comments

Comments
 (0)