Skip to content

Commit b5bb814

Browse files
committed
Swift: fix toString of some invisible DeclRefExprs
1 parent f6d5e8d commit b5bb814

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

swift/ql/.generated.list

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ ql/lib/codeql/swift/elements/decl/ConcreteFuncDeclConstructor.qll 4eb2e9dc8b4c93
1818
ql/lib/codeql/swift/elements/decl/ConcreteVarDecl.qll be33f40e8870a10aec413f35d8f62a502d7d5dd8a52665730740e880566206d7 d821efa43c6d83aedfb959500de42c5ecabbf856f8556f739bc6cec30a88dfab
1919
ql/lib/codeql/swift/elements/decl/ConcreteVarDeclConstructor.qll 4b6a9f458db5437f9351b14464b3809a78194029554ea818b3e18272c17afba3 a60d695b0d0ffa917ad01908bec2beaa663e644eddb00fb370fbc906623775d4
2020
ql/lib/codeql/swift/elements/decl/ConstructorDeclConstructor.qll ba5cc6f440cba3d47b364a37febd64f85941cdc0237db52a2b8844d1dc75d483 9fc039ca7a0f33f03b3f573186f02efecbac0c2e0dc5abba5d47876ca26390fe
21-
ql/lib/codeql/swift/elements/decl/Decl.qll 7a7ea5727a238684e783adf04ce8f721bf4451e1324ffc966ad671d60a43d64b 662e53ffc8226ae351032d0389784e6b70d517794e83a4c698ac84996361608f
2221
ql/lib/codeql/swift/elements/decl/DestructorDeclConstructor.qll c33b113a3ccb0b1bfd9aad8b909940776da5fdb8a24e1b998c5ebde3903be981 155ad928fbebf9688eec30a2cf61d9a2d4cd15d1161dc3f6202e6331bdb3a56a
2322
ql/lib/codeql/swift/elements/decl/EnumCaseDeclConstructor.qll 8c907544170671f713a8665d294eeefdbe78a607c2f16e2c630ea9c33f484baf eec83efc930683628185dbdad8f73311aad510074d168a53d85ea09d13f1f7e1
2423
ql/lib/codeql/swift/elements/decl/EnumDecl.qll 04271e164379af3a33eb060d230b768878e06acc37c3d132cad089a2c663c6c4 779940ebdbd510eb651972c57eb84b04af39c44ef59a8c307a44549ab730febb
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// generated by codegen/codegen.py, remove this comment if you wish to edit this file
21
private import codeql.swift.generated.decl.Decl
32

4-
class Decl extends Generated::Decl { }
3+
class Decl extends Generated::Decl {
4+
override string toString() { result = super.toString() }
5+
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
private import codeql.swift.generated.expr.DeclRefExpr
22

33
class DeclRefExpr extends Generated::DeclRefExpr {
4-
override string toString() { result = this.getDecl().toString() }
4+
override string toString() {
5+
if exists(this.getDecl().toString())
6+
then result = this.getDecl().toString()
7+
else result = "(unknown declaration)"
8+
}
59
}

0 commit comments

Comments
 (0)