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

Co-authored-by: Tom Hvitved <hvitved@github.com>
This commit is contained in:
Anders Schack-Mulligen
2025-06-13 14:07:46 +02:00
committed by GitHub
parent d0d47808e9
commit 6131c680f6

View File

@@ -1123,9 +1123,12 @@ private module ControlFlowGraphImpl {
or
// `assert` statements may throw
completion = ThrowCompletion(assertionError()) and
if exists(assertstmt.getMessage())
then last(assertstmt.getMessage(), last, NormalCompletion())
else last(assertstmt.getExpr(), last, BooleanCompletion(false, _))
(
last(assertstmt.getMessage(), last, NormalCompletion())
or
not exists(assertstmt.getMessage()) and
last(assertstmt.getExpr(), last, BooleanCompletion(false, _))
)
)
or
// `throw` statements or throwing calls give rise to `Throw` completion