Changeset 209074 in webkit
- Timestamp:
- Nov 29, 2016 9:18:03 AM (7 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r209070 r209074 1 2016-11-29 Darin Adler <darin@apple.com> 2 3 REGRESSION (r209058): API test StringBuilderTest.Equal crashing 4 https://bugs.webkit.org/show_bug.cgi?id=165142 5 6 * wtf/text/StringBuilder.h: Added an overload of the equal function just 7 for the case where the arguments are StringBuilder, String. This is needed 8 because of the peculiar behavior of is8Bit in String, different from any of 9 our other string classes. I think we should consider changing String::is8Bit 10 to return true for null strings. We could then remove this overload and 11 probably remove other checks for null and zero length elsewhere that are 12 also needed only to avoid calling is8Bit on a null String. 13 1 14 2016-11-29 Wenson Hsieh <wenson_hsieh@apple.com> 2 15 -
trunk/Source/WTF/wtf/text/StringBuilder.h
r209058 r209074 301 301 302 302 template<typename StringType> bool equal(const StringBuilder&, const StringType&); 303 bool equal(const StringBuilder&, const String&); // Only needed because is8Bit dereferences nullptr when the string is null. 303 304 template<typename CharacterType> bool equal(const StringBuilder&, const CharacterType*, unsigned length); 304 305 … … 326 327 } 327 328 329 inline bool equal(const StringBuilder& a, const String& b) 330 { 331 return !b.isNull() && equalCommon(a, b); 332 } 333 328 334 inline bool operator==(const StringBuilder& a, const StringBuilder& b) { return equal(a, b); } 329 335 inline bool operator!=(const StringBuilder& a, const StringBuilder& b) { return !equal(a, b); }
Note: See TracChangeset
for help on using the changeset viewer.