Skip to content

Commit 56f4694

Browse files
committed
Swift: Avoid calling Element.toString recursively
1 parent c14a237 commit 56f4694

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ private import codeql.swift.elements.decl.Initializer
55
final private class InitializerLookupExprImpl extends Impl::MethodLookupExpr {
66
InitializerLookupExprImpl() { super.getMethod() instanceof Initializer }
77

8-
override string toStringImpl() { result = this.getMember().toString() }
8+
override string toStringImpl() { result = this.getMember().toStringImpl() }
99
}
1010

1111
final class InitializerLookupExpr extends MethodLookupExpr, InitializerLookupExprImpl {

swift/ql/lib/codeql/swift/elements/expr/internal/ApplyExprImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ module Impl {
4848

4949
override Expr getQualifier() { result = expr.getQualifier() }
5050

51-
override string toStringImpl() { result = "call to " + expr }
51+
override string toStringImpl() { result = "call to " + expr.toStringImpl() }
5252
}
5353

5454
private class FullDotSyntaxBaseIgnoredApplyExpr extends ApplyExpr {

swift/ql/lib/codeql/swift/elements/expr/internal/ExplicitCastExprImpl.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ module Impl {
44
class ExplicitCastExpr extends Generated::ExplicitCastExpr {
55
override predicate convertsFrom(Expr e) { e = this.getImmediateSubExpr() }
66

7-
override string toStringImpl() { result = "(" + this.getType() + ") ..." }
7+
override string toStringImpl() { result = "(" + this.getType().toStringImpl() + ") ..." }
88
}
99
}

0 commit comments

Comments
 (0)