Skip to content

Commit e2dbd7f

Browse files
committed
Cfg: Support Throw expressions.
1 parent d4a0846 commit e2dbd7f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ private module Ast implements AstSig<Location> {
9393

9494
class ReturnStmt = J::ReturnStmt;
9595

96-
class ThrowStmt = J::ThrowStmt;
96+
class Throw = J::ThrowStmt;
9797

9898
final private class FinalTryStmt = J::TryStmt;
9999

shared/controlflow/codeql/controlflow/ControlFlowGraph.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ signature module AstSig<LocationSig Location> {
155155
}
156156

157157
/**
158-
* A `throw` statement.
158+
* A `throw` statement or expression.
159159
*
160-
* Throw statements complete abruptly and throw an exception.
160+
* Throw statements/expressions complete abruptly and throw an exception.
161161
*/
162-
class ThrowStmt extends Stmt {
162+
class Throw extends AstNode {
163163
/** Gets the expression being thrown. */
164164
Expr getExpr();
165165
}
@@ -426,7 +426,7 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
426426
or
427427
n instanceof ReturnStmt
428428
or
429-
n instanceof ThrowStmt
429+
n instanceof Throw
430430
or
431431
n instanceof BreakStmt
432432
or
@@ -563,7 +563,7 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
563563
or
564564
n instanceof ReturnStmt
565565
or
566-
n instanceof ThrowStmt
566+
n instanceof Throw
567567
or
568568
cannotTerminateNormally(n.(BlockStmt).getLastStmt())
569569
or
@@ -992,7 +992,7 @@ module Make0<LocationSig Location, AstSig<Location> Ast> {
992992
ast instanceof ReturnStmt and
993993
c.getSuccessorType() instanceof ReturnSuccessor
994994
or
995-
ast instanceof ThrowStmt and
995+
ast instanceof Throw and
996996
c.getSuccessorType() instanceof ExceptionSuccessor
997997
or
998998
ast instanceof BreakStmt and

0 commit comments

Comments
 (0)