Changeset 221192 in webkit for trunk/Source/JavaScriptCore/runtime/JSString.h
- Timestamp:
- Aug 25, 2017, 10:27:46 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSString.h
r216699 r221192 165 165 const StringImpl* tryGetValueImpl() const; 166 166 ALWAYS_INLINE unsigned length() const { return m_length; } 167 ALWAYS_INLINE static bool isValidLength(size_t length)168 {169 // While length is of type unsigned, the runtime and compilers are all170 // expecting that m_length is a positive value <= INT_MAX.171 // FIXME: Look into making the max length UINT_MAX to match StringImpl's max length.172 // https://bugs.webkit.org/show_bug.cgi?id=163955173 return length <= std::numeric_limits<int32_t>::max();174 }175 167 176 168 JSValue toPrimitive(ExecState*, PreferredPrimitiveType) const; … … 220 212 ALWAYS_INLINE void setLength(unsigned length) 221 213 { 222 RELEASE_ASSERT(isValidLength(length));223 214 m_length = length; 224 215 }
Note:
See TracChangeset
for help on using the changeset viewer.