Changeset 264379 in webkit
- Timestamp:
- Jul 14, 2020, 3:51:19 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r264336 r264379 1 2020-07-14 Mark Lam <mark.lam@apple.com> 2 3 Handle out of memory error while creating an error message in the literal parser. 4 https://bugs.webkit.org/show_bug.cgi?id=214313 5 <rdar://problem/65031745> 6 7 Reviewed by Saam Barati. 8 9 * stress/out-of-memory-making-error-string-in-literal-parser.js: Added. 10 1 11 2020-07-14 Angelos Oikonomopoulos <angelos@igalia.com> 2 12 -
trunk/Source/JavaScriptCore/ChangeLog
r264369 r264379 1 2020-07-14 Mark Lam <mark.lam@apple.com> 2 3 Handle out of memory error while creating an error message in the literal parser. 4 https://bugs.webkit.org/show_bug.cgi?id=214313 5 <rdar://problem/65031745> 6 7 Reviewed by Saam Barati. 8 9 * runtime/LiteralParser.cpp: 10 (JSC::LiteralParser<CharType>::parse): 11 1 12 2020-07-14 Caitlin Potter <caitp@igalia.com> 2 13 -
trunk/Source/JavaScriptCore/runtime/LiteralParser.cpp
r261895 r264379 994 994 case TokIdentifier: { 995 995 typename Lexer::LiteralParserTokenPtr token = m_lexer.currentToken(); 996 if (token->stringIs8Bit) 997 m_parseErrorMessage = makeString("Unexpected identifier \"", StringView { token->stringToken8, token->stringLength }, '"'); 998 else 999 m_parseErrorMessage = makeString("Unexpected identifier \"", StringView { token->stringToken16, token->stringLength }, '"'); 996 997 auto tryMakeErrorString = [=] (typename Lexer::LiteralParserTokenPtr token, unsigned length, bool addEllipsis) -> String { 998 if (token->stringIs8Bit) 999 return tryMakeString("Unexpected identifier \"", StringView { token->stringToken8, length }, addEllipsis ? "..." : "", '"'); 1000 return tryMakeString("Unexpected identifier \"", StringView { token->stringToken16, length }, addEllipsis ? "..." : "", '"'); 1001 }; 1002 1003 String errorString = tryMakeErrorString(token, token->stringLength, false); 1004 if (!errorString) { 1005 constexpr unsigned shortLength = 10; 1006 if (token->stringLength > shortLength) 1007 errorString = tryMakeErrorString(token, shortLength, true); 1008 if (!errorString) 1009 errorString = "Unexpected identifier"; 1010 } 1011 1012 m_parseErrorMessage = errorString; 1000 1013 return JSValue(); 1001 1014 }
Note:
See TracChangeset
for help on using the changeset viewer.