Changeset 280886 in webkit
- Timestamp:
- Aug 11, 2021, 12:39:26 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
-
JSTests/ChangeLog (modified) (1 diff)
-
JSTests/stress/directive-includes-non-latin1.js (added)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/parser/Lexer.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r280825 r280886 1 2021-08-11 Yusuke Suzuki <ysuzuki@apple.com> 2 3 WTFCrash in JSC::Lexer<char16_t>::append8 4 https://bugs.webkit.org/show_bug.cgi?id=228982 5 6 Reviewed by Mark Lam. 7 8 * stress/directive-includes-non-latin1.js: Added. 9 1 10 2021-08-09 Yusuke Suzuki <ysuzuki@apple.com> 2 11 -
trunk/Source/JavaScriptCore/ChangeLog
r280858 r280886 1 2021-08-11 Yusuke Suzuki <ysuzuki@apple.com> 2 3 WTFCrash in JSC::Lexer<char16_t>::append8 4 https://bugs.webkit.org/show_bug.cgi?id=228982 5 6 Reviewed by Mark Lam. 7 8 sourceURL / sourceMapURL directive should not assume Latin1 characters. 9 10 * parser/Lexer.cpp: 11 (JSC::Lexer<T>::parseCommentDirectiveValue): 12 1 13 2021-08-10 Keith Miller <keith_miller@apple.com> 2 14 -
trunk/Source/JavaScriptCore/parser/Lexer.cpp
r280825 r280886 1843 1843 { 1844 1844 skipWhitespace(); 1845 bool hasNonLatin1 = false; 1845 1846 const T* stringStart = currentSourcePtr(); 1846 while (!isWhiteSpace(m_current) && !isLineTerminator(m_current) && m_current != '"' && m_current != '\'' && !atEnd()) 1847 shift(); 1847 while (!isWhiteSpace(m_current) && !isLineTerminator(m_current) && m_current != '"' && m_current != '\'' && !atEnd()) { 1848 if (!isLatin1(m_current)) 1849 hasNonLatin1 = true; 1850 shift(); 1851 } 1848 1852 const T* stringEnd = currentSourcePtr(); 1849 1853 skipWhitespace(); … … 1852 1856 return String(); 1853 1857 1854 append8(stringStart, stringEnd - stringStart); 1855 String result = String(m_buffer8.data(), m_buffer8.size()); 1856 m_buffer8.shrink(0); 1858 unsigned length = stringEnd - stringStart; 1859 if (hasNonLatin1) { 1860 UChar* buffer = nullptr; 1861 String result = StringImpl::createUninitialized(length, buffer); 1862 StringImpl::copyCharacters(buffer, stringStart, length); 1863 return result; 1864 } 1865 1866 LChar* buffer = nullptr; 1867 String result = StringImpl::createUninitialized(length, buffer); 1868 StringImpl::copyCharacters(buffer, stringStart, length); 1857 1869 return result; 1858 1870 }
Note:
See TracChangeset
for help on using the changeset viewer.