Skip to content

Commit 3c4e877

Browse files
committed
Java: Minor refactor.
1 parent f812367 commit 3c4e877

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

java/ql/src/semmle/code/java/dataflow/internal/DataFlowPrivate.qll

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -312,18 +312,15 @@ class ConstantBooleanExprNode extends ArgumentNode, ExprNode {
312312
cached
313313
predicate isUnreachableInCall(Node n, DataFlowCall call) {
314314
exists(
315-
ExplicitParameterNode paramNode, ConstantBooleanExprNode arg, BasicBlock bb,
316-
SsaImplicitInit varInit, Guard guard
315+
ExplicitParameterNode paramNode, ConstantBooleanExprNode arg, SsaImplicitInit param, Guard guard
317316
|
318-
// get argument and parameter for this call
317+
// get constant bool argument and parameter for this call
319318
viableParamArg(call, paramNode, arg) and
320319
// get the ssa variable definition for this parameter
321-
varInit.isParameterDefinition(paramNode.getParameter()) and
320+
param.isParameterDefinition(paramNode.getParameter()) and
322321
// which is used in a guard
323-
varInit.getAUse() = guard and
324-
// which controls that bb is not active
325-
guard.controls(bb, arg.getBooleanValue().booleanNot()) and
326-
// and the node we pass in is in this bb
327-
bb.getANode() = n.asExpr()
322+
param.getAUse() = guard and
323+
// which controls `n` with the opposite value of `arg`
324+
guard.controls(n.asExpr().getBasicBlock(), arg.getBooleanValue().booleanNot())
328325
)
329326
}

0 commit comments

Comments
 (0)