| Index: third_party/WebKit/Source/wtf/text/WTFString.cpp
|
| diff --git a/third_party/WebKit/Source/wtf/text/WTFString.cpp b/third_party/WebKit/Source/wtf/text/WTFString.cpp
|
| index c69d61aec387077a596f77774e9b35ea966c7f23..269f943ca06407145ee39359a9e7907a3b0577ba 100644
|
| --- a/third_party/WebKit/Source/wtf/text/WTFString.cpp
|
| +++ b/third_party/WebKit/Source/wtf/text/WTFString.cpp
|
| @@ -92,7 +92,7 @@ void String::append(const String& string)
|
|
|
| if (m_impl->is8Bit() && string.m_impl->is8Bit()) {
|
| LChar* data;
|
| - CHECK_LE(string.length(), std::numeric_limits<unsigned>::max() - m_impl->length());
|
| + RELEASE_ASSERT(string.length() <= std::numeric_limits<unsigned>::max() - m_impl->length());
|
| RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(m_impl->length() + string.length(), data);
|
| memcpy(data, m_impl->characters8(), m_impl->length() * sizeof(LChar));
|
| memcpy(data + m_impl->length(), string.characters8(), string.length() * sizeof(LChar));
|
| @@ -101,7 +101,7 @@ void String::append(const String& string)
|
| }
|
|
|
| UChar* data;
|
| - CHECK_LE(string.length(), std::numeric_limits<unsigned>::max() - m_impl->length());
|
| + RELEASE_ASSERT(string.length() <= std::numeric_limits<unsigned>::max() - m_impl->length());
|
| RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(m_impl->length() + string.length(), data);
|
|
|
| if (m_impl->is8Bit())
|
| @@ -131,7 +131,7 @@ inline void String::appendInternal(CharacterType c)
|
|
|
| // FIXME: We should be able to create an 8 bit string via this code path.
|
| UChar* data;
|
| - CHECK_LT(m_impl->length(), std::numeric_limits<unsigned>::max());
|
| + RELEASE_ASSERT(m_impl->length() < std::numeric_limits<unsigned>::max());
|
| RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(m_impl->length() + 1, data);
|
| if (m_impl->is8Bit())
|
| StringImpl::copyChars(data, m_impl->characters8(), m_impl->length());
|
| @@ -189,7 +189,7 @@ void String::append(const LChar* charactersToAppend, unsigned lengthToAppend)
|
| unsigned strLength = m_impl->length();
|
|
|
| if (m_impl->is8Bit()) {
|
| - CHECK_LE(lengthToAppend, std::numeric_limits<unsigned>::max() - strLength);
|
| + RELEASE_ASSERT(lengthToAppend <= std::numeric_limits<unsigned>::max() - strLength);
|
| LChar* data;
|
| RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(strLength + lengthToAppend, data);
|
| StringImpl::copyChars(data, m_impl->characters8(), strLength);
|
| @@ -198,7 +198,7 @@ void String::append(const LChar* charactersToAppend, unsigned lengthToAppend)
|
| return;
|
| }
|
|
|
| - CHECK_LE(lengthToAppend, std::numeric_limits<unsigned>::max() - strLength);
|
| + RELEASE_ASSERT(lengthToAppend <= std::numeric_limits<unsigned>::max() - strLength);
|
| UChar* data;
|
| RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(length() + lengthToAppend, data);
|
| StringImpl::copyChars(data, m_impl->characters16(), strLength);
|
| @@ -221,7 +221,7 @@ void String::append(const UChar* charactersToAppend, unsigned lengthToAppend)
|
| unsigned strLength = m_impl->length();
|
|
|
| ASSERT(charactersToAppend);
|
| - CHECK_LE(lengthToAppend, std::numeric_limits<unsigned>::max() - strLength);
|
| + RELEASE_ASSERT(lengthToAppend <= std::numeric_limits<unsigned>::max() - strLength);
|
| UChar* data;
|
| RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(strLength + lengthToAppend, data);
|
| if (m_impl->is8Bit())
|
| @@ -240,7 +240,7 @@ PassRefPtr<StringImpl> insertInternal(PassRefPtr<StringImpl> impl, const CharTyp
|
|
|
| ASSERT(charactersToInsert);
|
| UChar* data; // FIXME: We should be able to create an 8 bit string here.
|
| - CHECK_LE(lengthToInsert, std::numeric_limits<unsigned>::max() - impl->length());
|
| + RELEASE_ASSERT(lengthToInsert <= std::numeric_limits<unsigned>::max() - impl->length());
|
| RefPtr<StringImpl> newImpl = StringImpl::createUninitialized(impl->length() + lengthToInsert, data);
|
|
|
| if (impl->is8Bit())
|
| @@ -432,7 +432,7 @@ Vector<UChar> String::charactersWithNullTermination() const
|
| unsigned String::copyTo(UChar* buffer, unsigned pos, unsigned maxLength) const
|
| {
|
| unsigned length = this->length();
|
| - CHECK_LE(pos, length);
|
| + RELEASE_ASSERT(pos <= length);
|
| unsigned numCharacters = std::min(length - pos, maxLength);
|
| if (!numCharacters)
|
| return 0;
|
| @@ -871,7 +871,7 @@ String String::make16BitFrom8BitSource(const LChar* source, size_t length)
|
|
|
| String String::fromUTF8(const LChar* stringStart, size_t length)
|
| {
|
| - CHECK_LE(length, std::numeric_limits<unsigned>::max());
|
| + RELEASE_ASSERT(length <= std::numeric_limits<unsigned>::max());
|
|
|
| if (!stringStart)
|
| return String();
|
|
|