Title: [248913] trunk/Source/WTF
Revision
248913
Author
sbar...@apple.com
Date
2019-08-20 12:45:43 -0700 (Tue, 20 Aug 2019)

Log Message

Unreviewed. Followup to r248903. It's not valid to remove
hasOverflowed() checks from appendCharacters.

* wtf/text/StringBuilder.cpp:
(WTF::StringBuilder::appendCharacters):

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (248912 => 248913)


--- trunk/Source/WTF/ChangeLog	2019-08-20 19:17:59 UTC (rev 248912)
+++ trunk/Source/WTF/ChangeLog	2019-08-20 19:45:43 UTC (rev 248913)
@@ -1,3 +1,11 @@
+2019-08-20  Saam Barati  <sbar...@apple.com>
+
+        Unreviewed. Followup to r248903. It's not valid to remove
+        hasOverflowed() checks from appendCharacters.
+
+        * wtf/text/StringBuilder.cpp:
+        (WTF::StringBuilder::appendCharacters):
+
 2019-08-20  Darin Adler  <da...@apple.com>
 
         Variadic StringBuilder::append does not handle upconverting from 8-bit to 16-bit correctly

Modified: trunk/Source/WTF/wtf/text/StringBuilder.cpp (248912 => 248913)


--- trunk/Source/WTF/wtf/text/StringBuilder.cpp	2019-08-20 19:17:59 UTC (rev 248912)
+++ trunk/Source/WTF/wtf/text/StringBuilder.cpp	2019-08-20 19:45:43 UTC (rev 248913)
@@ -325,7 +325,7 @@
 
 void StringBuilder::appendCharacters(const UChar* characters, unsigned length)
 {
-    if (!length)
+    if (!length || hasOverflowed())
         return;
 
     ASSERT(characters);
@@ -347,7 +347,7 @@
 
 void StringBuilder::appendCharacters(const LChar* characters, unsigned length)
 {
-    if (!length)
+    if (!length || hasOverflowed())
         return;
 
     ASSERT(characters);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to