Changeset 221192 in webkit
- Timestamp:
- Aug 25, 2017, 10:27:46 AM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
runtime/JSString.h (modified) (2 diffs)
-
runtime/JSStringBuilder.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r221176 r221192 1 2017-08-25 Keith Miller <keith_miller@apple.com> 2 3 Explore increasing max JSString::m_length to UINT_MAX. 4 https://bugs.webkit.org/show_bug.cgi?id=163955 5 <rdar://problem/32001499> 6 7 Reviewed by JF Bastien. 8 9 This can cause us to release assert on some code paths. I don't 10 see a reason to maintain this restriction. 11 12 * runtime/JSString.h: 13 (JSC::JSString::length const): 14 (JSC::JSString::setLength): 15 (JSC::JSString::isValidLength): Deleted. 16 * runtime/JSStringBuilder.h: 17 (JSC::jsMakeNontrivialString): 18 1 19 2017-08-24 Commit Queue <commit-queue@webkit.org> 2 20 -
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 } -
trunk/Source/JavaScriptCore/runtime/JSStringBuilder.h
r209761 r221192 132 132 auto scope = DECLARE_THROW_SCOPE(vm); 133 133 String result = tryMakeString(string, strings...); 134 if (UNLIKELY(!result || !JSString::isValidLength(result.length())))134 if (UNLIKELY(!result)) 135 135 return throwOutOfMemoryError(exec, scope); 136 136 return jsNontrivialString(exec, WTFMove(result));
Note:
See TracChangeset
for help on using the changeset viewer.