File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
java/ql/lib/semmle/code/java/controlflow Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,14 @@ private module Input implements BB::InputSig<Location> {
1919 /** Gets the CFG scope in which this node occurs. */
2020 CfgScope nodeGetCfgScope ( Node node ) { node .getEnclosingCallable ( ) = result }
2121
22+ private Node getATrivialBooleanSuccessor ( Node node ) {
23+ result = unique( Node n | n = node .( ConditionNode ) .getABranchSuccessor ( _) ) and
24+ node .asExpr ( ) instanceof BooleanLiteral
25+ }
26+
2227 private Node getASpecificSuccessor ( Node node , SuccessorType t ) {
23- node .( ConditionNode ) .getABranchSuccessor ( t .( BooleanSuccessor ) .getValue ( ) ) = result
28+ node .( ConditionNode ) .getABranchSuccessor ( t .( BooleanSuccessor ) .getValue ( ) ) = result and
29+ not result = getATrivialBooleanSuccessor ( node )
2430 or
2531 node .getAnExceptionSuccessor ( ) = result and t instanceof ExceptionSuccessor
2632 }
You can’t perform that action at this time.
0 commit comments