@@ -113,9 +113,7 @@ private class StringLengthConflationSources extends SourceModelCsv {
113
113
override predicate row ( string row ) {
114
114
row =
115
115
[
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" ,
119
117
";NSMutableString;true;length;;;;nsstring-length" ,
120
118
]
121
119
}
@@ -128,12 +126,23 @@ private class ExtraStringLengthConflationSource extends StringLengthConflationSo
128
126
StringType stringType ;
129
127
130
128
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
134
144
memberRef .getMember ( ) .( VarDecl ) .getName ( ) = "count" and
135
- this .asExpr ( ) = memberRef and
136
- stringType = "String.unicodeScalars"
145
+ this .asExpr ( ) = memberRef
137
146
)
138
147
}
139
148
0 commit comments