Skip to content

Commit 4ba2984

Browse files
committed
Swift: Fix Code Scanning alerts.
1 parent 2882c42 commit 4ba2984

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

swift/ql/lib/codeql/swift/controlflow/CfgNodes.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class AstCfgNode extends ControlFlowNode, TElementNode {
7575
override Location getLocation() { result = n.getLocation() }
7676

7777
final override string toString() {
78-
exists(string s | s = n.(AstNode).toString() |
78+
exists(string s | s = n.toString() |
7979
result = "[" + this.getSplitsString() + "] " + s
8080
or
8181
not exists(this.getSplitsString()) and result = s

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,16 @@ module Stmts {
100100
*/
101101
private BraceStmt getFirstDeferStmtBody() {
102102
exists(int i |
103-
result = getDeferStmtBody(i) and
104-
not exists(getDeferStmtBody(i + 1))
103+
result = this.getDeferStmtBody(i) and
104+
not exists(this.getDeferStmtBody(i + 1))
105105
)
106106
}
107107

108108
/** Gets the body of the last `defer` statement to be executed. */
109109
private BraceStmt getLastDeferStmtBody() {
110110
exists(int i |
111-
result = getDeferStmtBody(i) and
112-
not exists(getDeferStmtBody(i - 1))
111+
result = this.getDeferStmtBody(i) and
112+
not exists(this.getDeferStmtBody(i - 1))
113113
)
114114
}
115115

@@ -130,9 +130,9 @@ module Stmts {
130130
exists(int j |
131131
// The result is the j'th statement (where the index is less than or equal to i)
132132
result = this.getDeferStmtBody(j) and
133-
getDeferIndex(j) <= i and
133+
this.getDeferIndex(j) <= i and
134134
// and the next defer statement is _after_ the i'th statement.
135-
not getDeferIndex(j + 1) <= i
135+
not this.getDeferIndex(j + 1) <= i
136136
)
137137
}
138138

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ predicate scopeLast(CfgScope scope, ControlFlowElement last, Completion c) {
4040
scope.(Impl::CfgScope::Range_).exit(last, c)
4141
}
4242

43-
/** The maximum number of splits allowed for a given node. */
43+
/** Gets the maximum number of splits allowed for a given node. */
4444
int maxSplits() { result = 5 }
4545

4646
class SplitKindBase = Splitting::TSplitKind;

swift/ql/lib/codeql/swift/elements/expr/BinaryExpr.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ private import codeql.swift.generated.expr.BinaryExpr
22
private import codeql.swift.elements.expr.Expr
33

44
class BinaryExpr extends BinaryExprBase {
5-
Expr getLeftOperand() { result = getArgument(0).getExpr() }
5+
Expr getLeftOperand() { result = this.getArgument(0).getExpr() }
66

7-
Expr getRightOperand() { result = getArgument(1).getExpr() }
7+
Expr getRightOperand() { result = this.getArgument(1).getExpr() }
88

99
Expr getAnOperand() { result = [this.getLeftOperand(), this.getRightOperand()] }
1010
}

swift/ql/lib/codeql/swift/elements/expr/Expr.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
private import codeql.swift.generated.expr.Expr
22

33
class Expr extends ExprBase {
4-
final override Expr getResolveStep() { convertsFrom(result) }
4+
final override Expr getResolveStep() { this.convertsFrom(result) }
55

66
predicate convertsFrom(Expr e) { none() } // overridden by subclasses
77

88
Expr getConversion() { result.convertsFrom(this) }
99

10-
predicate isConversion() { convertsFrom(_) }
10+
predicate isConversion() { this.convertsFrom(_) }
1111

12-
predicate hasConversions() { exists(getConversion()) }
12+
predicate hasConversions() { exists(this.getConversion()) }
1313

1414
Expr getFullyConverted() { result = this.getFullyUnresolved() }
1515

0 commit comments

Comments
 (0)