Skip to content

Commit 77d4f5a

Browse files
committed
Cfg: Update fallsThrough default.
1 parent edf88b3 commit 77d4f5a

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

java/ql/lib/semmle/code/java/ControlFlowGraph.qll

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ private module Ast implements AstSig<Location> {
165165

166166
class DefaultCase extends Case instanceof J::DefaultCase { }
167167

168-
predicate fallsThrough(Case c) { not c.(J::SwitchCase).isRule() }
169-
170168
class ConditionalExpr = J::ConditionalExpr;
171169

172170
class BinaryExpr = J::BinaryExpr;

shared/controlflow/codeql/controlflow/ControlFlowGraph.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ signature module AstSig<LocationSig Location> {
261261
* Holds if this case can fall through to the next case if it is not
262262
* otherwise prevented with a `break` or similar.
263263
*/
264-
default predicate fallsThrough(Case c) { none() }
264+
default predicate fallsThrough(Case c) { not exists(c.getBody()) }
265265

266266
/** A ternary conditional expression. */
267267
class ConditionalExpr extends Expr {

0 commit comments

Comments
 (0)