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 {
286
286
* That is, contexts where the control-flow edges depend on `value` given that `b` ends
287
287
* with a `booleanCompletion(value, _)`.
288
288
*/
289
- private predicate inBooleanContext ( Expr b ) {
289
+ private predicate inBooleanContext ( ControlFlowNode b ) {
290
290
exists ( LogicExpr logexpr |
291
291
logexpr .( BinaryExpr ) .getLeftOperand ( ) = b
292
292
or
@@ -316,6 +316,10 @@ private module ControlFlowGraphImpl {
316
316
inBooleanContext ( whenexpr ) and
317
317
whenexpr .getBranch ( _) .getAResult ( ) = b
318
318
)
319
+ or
320
+ inBooleanContext ( b .( ExprStmt ) .getExpr ( ) )
321
+ or
322
+ inBooleanContext ( b .( StmtExpr ) .getStmt ( ) )
319
323
}
320
324
321
325
/**
@@ -907,7 +911,7 @@ private module ControlFlowGraphImpl {
907
911
)
908
912
or
909
913
// 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
911
915
or
912
916
// the last node in a `StmtExpr` is the last node in the statement
913
917
last ( n .( StmtExpr ) .getStmt ( ) , last , completion )
You can’t perform that action at this time.
0 commit comments