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
22
33class ExtensionDecl extends Generated:: ExtensionDecl {
44 override string toString ( ) {
5- result = "extension of " + this .getExtendedTypeDecl ( ) .toString ( )
5+ result =
6+ "extension of " + unique( NominalTypeDecl td | td = this .getExtendedTypeDecl ( ) ) .toString ( )
67 or
7- not exists ( this .getExtendedTypeDecl ( ) ) and
8+ count ( this .getExtendedTypeDecl ( ) ) != 1 and
89 result = "extension"
910 }
1011}
Original file line number Diff line number Diff line change @@ -109,13 +109,13 @@ class TypeDecl extends Generated::TypeDecl {
109109 cached
110110 string getFullName ( ) {
111111 not this .getEnclosingDecl ( ) instanceof TypeDecl and
112- not this .getEnclosingDecl ( ) instanceof ExtensionDecl and
112+ not count ( this .getEnclosingDecl ( ) . ( ExtensionDecl ) . getExtendedTypeDecl ( ) ) = 1 and
113113 result = this .getName ( )
114114 or
115115 result = this .getEnclosingDecl ( ) .( TypeDecl ) .getFullName ( ) + "." + this .getName ( )
116116 or
117117 result =
118- this .getEnclosingDecl ( ) .( ExtensionDecl ) .getExtendedTypeDecl ( ) . getFullName ( ) + "." +
119- this .getName ( )
118+ unique ( NominalTypeDecl td | td = this .getEnclosingDecl ( ) .( ExtensionDecl ) .getExtendedTypeDecl ( ) )
119+ . getFullName ( ) + "." + this .getName ( )
120120 }
121121}
You can’t perform that action at this time.
0 commit comments