Skip to content

Commit 2460be6

Browse files
committed
C#: Reduce reliance on CFG nodes in DataFlow::Node.
1 parent af63e63 commit 2460be6

File tree

4 files changed

+122
-178
lines changed

4 files changed

+122
-178
lines changed

csharp/ql/consistency-queries/DataFlowConsistency.ql

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,6 @@ private module Input implements InputSig<Location, CsharpDataFlow> {
7070
init.getInitializer().getNumberOfChildren() > 1
7171
)
7272
or
73-
exists(ControlFlow::Nodes::ElementNode cfn, ControlFlow::Nodes::Split split |
74-
exists(arg.asExprAtNode(cfn))
75-
|
76-
split = cfn.getASplit() and
77-
not split = call.getControlFlowNode().getASplit()
78-
or
79-
split = call.getControlFlowNode().getASplit() and
80-
not split = cfn.getASplit()
81-
)
82-
or
8373
call.(NonDelegateDataFlowCall).getDispatchCall().isReflection()
8474
)
8575
}

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)