Addressing post-review comment on r174297.
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Oct 2014 23:54:27 +0000 (23:54 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 Oct 2014 23:54:27 +0000 (23:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137355

Unreviewed.

* rendering/RenderText.cpp:
(WebCore::RenderText::stringView):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174373 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderText.cpp

index b1c8a31..aed9d42 100644 (file)
@@ -1,5 +1,15 @@
 2014-10-06  Myles C. Maxfield  <mmaxfield@apple.com>
 
+        Addressing post-review comment on r174297.
+        https://bugs.webkit.org/show_bug.cgi?id=137355
+
+        Unreviewed.
+
+        * rendering/RenderText.cpp:
+        (WebCore::RenderText::stringView):
+
+2014-10-06  Myles C. Maxfield  <mmaxfield@apple.com>
+
         Unreviewed merge fix for r174279.
         https://bugs.webkit.org/show_bug.cgi?id=137097
 
index fc75302..9fa82e6 100644 (file)
@@ -1527,6 +1527,11 @@ void RenderText::momentarilyRevealLastTypedCharacter(unsigned lastTypedCharacter
 
 StringView RenderText::stringView(int start, int stop) const
 {
+    ASSERT(static_cast<unsigned>(start) <= length());
+    ASSERT(static_cast<unsigned>(stop) <= length());
+    ASSERT(start <= stop);
+    ASSERT(start >= 0);
+    ASSERT(stop >= 0);
     if (is8Bit())
         return StringView(characters8() + start, stop - start);
     return StringView(characters16() + start, stop - start);