Skip to content

Commit 50b9339

Browse files
committed
Java: Perf fix.
1 parent 45827f6 commit 50b9339

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

java/ql/lib/semmle/code/java/dataflow/internal/DataFlowPrivate.qll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ module ExceptionFlow {
120120
not tryCatch(_, s1)
121121
}
122122

123+
pragma[nomagic]
124+
private Callable excReturnGetCallable(ExceptionReturnNode n) { result = n.getEnclosingCallable() }
125+
123126
/** Holds if a thrown exception can flow locally from `node1` to `node2`. */
124127
predicate localStep(Node node1, Node node2) {
125128
exists(Stmt exc |
@@ -135,7 +138,7 @@ module ExceptionFlow {
135138
or
136139
exists(Callable callable |
137140
excStep+(exc, callable.getBody()) and
138-
node2.(ExceptionReturnNode).getEnclosingCallable() = callable
141+
excReturnGetCallable(node2) = callable
139142
)
140143
)
141144
or

0 commit comments

Comments
 (0)