Skip to content

Commit 3159b3d

Browse files
committed
swift: fix unused variable
1 parent f9195d1 commit 3159b3d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

swift/ql/lib/codeql/swift/controlflow/internal/Completion.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ abstract class Completion extends TCompletion {
7070
predicate isValidFor(ControlFlowElement n) {
7171
this.isValidForSpecific(n)
7272
or
73-
mayHaveThrowCompletion(n, this)
73+
this instanceof ThrowCompletion and
74+
mayHaveThrowCompletion(n)
7475
or
7576
not any(Completion c).isValidForSpecific(n) and
7677
this = TSimpleCompletion()
@@ -320,7 +321,7 @@ private predicate mustHaveThrowCompletion(ThrowStmt throw, ThrowCompletion c) {
320321

321322
private predicate isThrowingType(AnyFunctionType type) { type.isThrowing() }
322323

323-
private predicate mayHaveThrowCompletion(ControlFlowElement n, ThrowCompletion c) {
324+
private predicate mayHaveThrowCompletion(ControlFlowElement n) {
324325
// An AST expression that may throw.
325326
isThrowingType(n.asAstNode().(ApplyExpr).getFunction().getType())
326327
or

0 commit comments

Comments
 (0)