Index: third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp |
diff --git a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp |
index 0dbf55c9d824a9a274c7926f7e30170c133a3824..6d01393db84bc2aaec7e7c0963a411d8d7199a74 100644 |
--- a/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/line/InlineTextBox.cpp |
@@ -616,6 +616,10 @@ TextRun InlineTextBox::constructTextRun( |
String string = getLineLayoutItem().text(); |
unsigned startPos = start(); |
unsigned length = len(); |
+ // Ensure |this| is in sync with the corresponding LayoutText. Checking here |
+ // has less binary size/perf impact than in StringView(). |
+ RELEASE_ASSERT(startPos <= string.length() && |
+ length <= string.length() - startPos); |
return constructTextRun(style, StringView(string, startPos, length), |
getLineLayoutItem().textLength() - startPos, |
charactersWithHyphen); |