File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
java/ql/lib/semmle/code/java Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ private module ControlFlowGraphImpl {
286286 * That is, contexts where the control-flow edges depend on `value` given that `b` ends
287287 * with a `booleanCompletion(value, _)`.
288288 */
289- private predicate inBooleanContext ( Expr b ) {
289+ private predicate inBooleanContext ( ControlFlowNode b ) {
290290 exists ( LogicExpr logexpr |
291291 logexpr .( BinaryExpr ) .getLeftOperand ( ) = b
292292 or
@@ -316,6 +316,10 @@ private module ControlFlowGraphImpl {
316316 inBooleanContext ( whenexpr ) and
317317 whenexpr .getBranch ( _) .getAResult ( ) = b
318318 )
319+ or
320+ inBooleanContext ( b .( ExprStmt ) .getExpr ( ) )
321+ or
322+ inBooleanContext ( b .( StmtExpr ) .getStmt ( ) )
319323 }
320324
321325 /**
@@ -907,7 +911,7 @@ private module ControlFlowGraphImpl {
907911 )
908912 or
909913 // the last node in an `ExprStmt` is the last node in the expression
910- last ( n .( ExprStmt ) .getExpr ( ) , last , completion ) and completion = NormalCompletion ( )
914+ last ( n .( ExprStmt ) .getExpr ( ) , last , completion ) and completion instanceof NormalOrBooleanCompletion
911915 or
912916 // the last node in a `StmtExpr` is the last node in the statement
913917 last ( n .( StmtExpr ) .getStmt ( ) , last , completion )
You can’t perform that action at this time.
0 commit comments