Changeset 201714 in webkit
- Timestamp:
- Jun 6, 2016 10:31:28 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201712 r201714 1 2016-06-03 Oliver Hunt <oliver@apple.com> 2 3 RegExp unicode parsing reads an extra character before failing 4 https://bugs.webkit.org/show_bug.cgi?id=158376 5 6 Reviewed by Saam Barati. 7 8 Add a couple of tests. 9 10 * js/script-tests/regexp-unicode.js: 11 1 12 2016-06-06 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/LayoutTests/js/regexp-unicode-expected.txt
r199523 r201714 152 152 PASS r = new RegExp("\\u", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. 153 153 PASS r = new RegExp("[\\u]", "u") threw exception SyntaxError: Invalid regular expression: invalid escaped character for unicode pattern. 154 PASS r = new RegExp("\\u{", "u") threw exception SyntaxError: Invalid regular expression: invalid unicode {} escape. 155 PASS r = new RegExp("\\u{\udead", "u") threw exception SyntaxError: Invalid regular expression: invalid unicode {} escape. 154 156 PASS successfullyParsed is true 155 157 -
trunk/LayoutTests/js/script-tests/regexp-unicode.js
r199523 r201714 206 206 var newRegExp; 207 207 208 function shouldThrowInvalidEscape(pattern )208 function shouldThrowInvalidEscape(pattern, error='invalidEscapeException') 209 209 { 210 210 newRegExp = 'r = new RegExp("' + pattern + '", "u")'; 211 211 212 shouldThrow(newRegExp, 'invalidEscapeException');212 shouldThrow(newRegExp, error); 213 213 } 214 214 … … 223 223 shouldThrowInvalidEscape("[\\\\u]"); 224 224 225 shouldThrowInvalidEscape("\\\\u{", '"SyntaxError: Invalid regular expression: invalid unicode {} escape"'); 226 shouldThrowInvalidEscape("\\\\u{\\udead", '"SyntaxError: Invalid regular expression: invalid unicode {} escape"'); -
trunk/Source/JavaScriptCore/ChangeLog
r201713 r201714 1 2016-06-03 Oliver Hunt <oliver@apple.com> 2 3 RegExp unicode parsing reads an extra character before failing 4 https://bugs.webkit.org/show_bug.cgi?id=158376 5 6 Reviewed by Saam Barati. 7 8 This was a probably harmless bug, but keeps triggering assertions 9 for me locally. Essentially we'd see a parse error, set the error 10 type, but then carry on parsing. In debug builds this asserts, in 11 release builds you are pretty safe unless you're exceptionally 12 unlucky with where the error occurs. 13 14 * yarr/YarrParser.h: 15 (JSC::Yarr::Parser::parseEscape): 16 1 17 2016-06-06 Guillaume Emont <guijemont@igalia.com> 2 18 -
trunk/Source/JavaScriptCore/yarr/YarrParser.h
r197534 r201714 449 449 UChar32 codePoint = 0; 450 450 do { 451 if (atEndOfPattern() )451 if (atEndOfPattern() || !isASCIIHexDigit(peek())) { 452 452 m_err = InvalidUnicodeEscape; 453 if (!isASCIIHexDigit(peek()))454 m_err = InvalidUnicodeEscape;453 break; 454 } 455 455 456 456 codePoint = (codePoint << 4) | toASCIIHexValue(consume());
Note: See TracChangeset
for help on using the changeset viewer.