Changeset 224055 in webkit for trunk/Source/JavaScriptCore/runtime/JSString.h
- Timestamp:
- Oct 26, 2017, 3:36:04 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSString.h
r222473 r224055 31 31 #include "ThrowScope.h" 32 32 #include <array> 33 #include <wtf/CheckedArithmetic.h> 33 34 #include <wtf/text/StringView.h> 34 35 … … 243 244 244 245 public: 245 class RopeBuilder { 246 template <class OverflowHandler = CrashOnOverflow> 247 class RopeBuilder : public OverflowHandler { 246 248 public: 247 249 RopeBuilder(VM& vm) … … 254 256 bool append(JSString* jsString) 255 257 { 258 if (UNLIKELY(this->hasOverflowed())) 259 return false; 256 260 if (m_index == JSRopeString::s_maxInternalRopeLength) 257 261 expand(); 258 262 if (static_cast<int32_t>(m_jsString->length() + jsString->length()) < 0) { 259 m_jsString = nullptr;263 this->overflowed(); 260 264 return false; 261 265 } … … 266 270 JSRopeString* release() 267 271 { 268 RELEASE_ASSERT( m_jsString);272 RELEASE_ASSERT(!this->hasOverflowed()); 269 273 JSRopeString* tmp = m_jsString; 270 m_jsString = 0;274 m_jsString = nullptr; 271 275 return tmp; 272 276 } 273 277 274 unsigned length() const { return m_jsString->length(); } 278 unsigned length() const 279 { 280 ASSERT(!this->hasOverflowed()); 281 return m_jsString->length(); 282 } 275 283 276 284 private:
Note:
See TracChangeset
for help on using the changeset viewer.