File tree Expand file tree Collapse file tree 3 files changed +10
-5
lines changed
codeql/swift/elements/decl Expand file tree Collapse file tree 3 files changed +10
-5
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ category : fix
3
+ ---
4
+ * Fixed an issue where ` TypeDecl.getFullName ` would get stuck in an loop and fail when minor database inconsistencies are present.
Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ private import codeql.swift.generated.decl.ExtensionDecl
2
2
3
3
class ExtensionDecl extends Generated:: ExtensionDecl {
4
4
override string toString ( ) {
5
- result = "extension of " + this .getExtendedTypeDecl ( ) .toString ( )
5
+ result =
6
+ "extension of " + unique( NominalTypeDecl td | td = this .getExtendedTypeDecl ( ) ) .toString ( )
6
7
or
7
- not exists ( this .getExtendedTypeDecl ( ) ) and
8
+ count ( this .getExtendedTypeDecl ( ) ) != 1 and
8
9
result = "extension"
9
10
}
10
11
}
Original file line number Diff line number Diff line change @@ -109,13 +109,13 @@ class TypeDecl extends Generated::TypeDecl {
109
109
cached
110
110
string getFullName ( ) {
111
111
not this .getEnclosingDecl ( ) instanceof TypeDecl and
112
- not this .getEnclosingDecl ( ) instanceof ExtensionDecl and
112
+ not count ( this .getEnclosingDecl ( ) . ( ExtensionDecl ) . getExtendedTypeDecl ( ) ) = 1 and
113
113
result = this .getName ( )
114
114
or
115
115
result = this .getEnclosingDecl ( ) .( TypeDecl ) .getFullName ( ) + "." + this .getName ( )
116
116
or
117
117
result =
118
- this .getEnclosingDecl ( ) .( ExtensionDecl ) .getExtendedTypeDecl ( ) . getFullName ( ) + "." +
119
- this .getName ( )
118
+ unique ( NominalTypeDecl td | td = this .getEnclosingDecl ( ) .( ExtensionDecl ) .getExtendedTypeDecl ( ) )
119
+ . getFullName ( ) + "." + this .getName ( )
120
120
}
121
121
}
You can’t perform that action at this time.
0 commit comments