@@ -361,9 +361,16 @@ module ControlFlow {
361361 }
362362
363363 /**
364- * Holds if `pred` is the node for the case `testExpr` in an expression
365- * switch statement which is switching on `switchExpr`, and `succ` is the
366- * node to be executed next if the case test succeeds.
364+ * Holds if `pred` is the node reached when a case of the expression switch
365+ * statement switching on `switchExpr` matches, `testExpr` is one of that
366+ * case's test expressions, and `succ` is the node to be executed next when
367+ * the case matches.
368+ *
369+ * In the control-flow graph the individual case test expressions of a case
370+ * clause all funnel into a single "matched" node for the clause, from which
371+ * control transfers to the case body. Hence `pred` is that shared matched
372+ * node, and the same `(pred, succ)` pair is reported once per test
373+ * expression `testExpr` of the clause.
367374 */
368375 predicate isSwitchCaseTestPassingEdge (
369376 ControlFlow:: Node pred , ControlFlow:: Node succ , Expr switchExpr , Expr testExpr
@@ -372,7 +379,7 @@ module ControlFlow {
372379 ess .getExpr ( ) = switchExpr and
373380 cc = ess .getACase ( ) and
374381 testExpr = cc .getExpr ( i ) and
375- pred .isAfter ( testExpr ) and
382+ pred .isAfter ( cc ) and
376383 succ .isFirstNodeOf ( cc .getStmt ( 0 ) )
377384 )
378385 }
0 commit comments