@@ -113,9 +113,7 @@ private class StringLengthConflationSources extends SourceModelCsv {
113113 override predicate row ( string row ) {
114114 row =
115115 [
116- ";String;true;count;;;;string-length" , ";String.UTF8View;true;count;;;;string-utf8-length" ,
117- ";String.UTF16View;true;count;;;;string-utf16-length" ,
118- ";NSString;true;length;;;;nsstring-length" ,
116+ ";String;true;count;;;;string-length" , ";NSString;true;length;;;;nsstring-length" ,
119117 ";NSMutableString;true;length;;;;nsstring-length" ,
120118 ]
121119 }
@@ -128,12 +126,23 @@ private class ExtraStringLengthConflationSource extends StringLengthConflationSo
128126 StringType stringType ;
129127
130128 ExtraStringLengthConflationSource ( ) {
131- exists ( MemberRefExpr memberRef |
132- // result of a call to `String.unicodeScalars.count`
133- memberRef .getBase ( ) .getType ( ) .( NominalType ) .getName ( ) = "String.UnicodeScalarView" and
129+ exists ( MemberRefExpr memberRef , string typeName |
130+ (
131+ // result of a call to `String.utf8.count`
132+ typeName = "String.UTF8View" and
133+ stringType = "String.utf8"
134+ or
135+ // result of a call to `String.utf16.count`
136+ typeName = "String.UTF16View" and
137+ stringType = "String.utf16"
138+ or
139+ // result of a call to `String.unicodeScalars.count`
140+ typeName = "String.UnicodeScalarView" and
141+ stringType = "String.unicodeScalars"
142+ ) and
143+ memberRef .getBase ( ) .getType ( ) .( NominalType ) .getName ( ) = typeName and
134144 memberRef .getMember ( ) .( VarDecl ) .getName ( ) = "count" and
135- this .asExpr ( ) = memberRef and
136- stringType = "String.unicodeScalars"
145+ this .asExpr ( ) = memberRef
137146 )
138147 }
139148
0 commit comments