Ignore:
Timestamp:
Dec 16, 2007, 5:26:54 PM (18 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

Reviewed by Maciej.

The problem was that \B was not handled properly in character classes.

Test: fast/js/regexp-overflow.html

  • pcre/pcre_compile.cpp: (check_escape): Added handling of ESC_b and ESC_B in character classes here. Allows us to get rid of the handling of \b in character classes from all the call sites that handle it separately and to handle \B properly as well. (compileBranch): Remove the ESC_b handling, since it's not needed any more. (calculateCompiledPatternLengthAndFlags): Ditto.

LayoutTests:

Reviewed by Maciej.

  • fast/js/regexp-overflow-expected.txt: Updated.
  • fast/js/resources/regexp-overflow.js: Added test cases.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/fast/js/resources/regexp-overflow.js

    r28491 r28785  
    1818shouldBe('/[\u00A1]{1,100}[\u00A1]{1,100}[\u00A1]{1,100}[\u00A1]{1,100}[\u00A1]{1,100}[\u00A1]{1,100}[\u00A1]{1,100}[\u00A1]{1,100}/.exec("\u00A1\u00A1\u00A1\u00A1\u00A1\u00A1\u00A1\u00A1").toString()', '"\u00A1\u00A1\u00A1\u00A1\u00A1\u00A1\u00A1\u00A1"');
    1919
     20shouldBe('/{([\\D-\\ca]]„£µ+?)}|[[\\B-\\u00d4]√π- ]]]{0,3}/i.exec("B√π- ]]").toString()', '"B√π- ]],"');
     21shouldBe('/|[x\\B-\\u00b5]/i.exec("").toString()', '""');
     22
    2023debug('');
    2124
Note: See TracChangeset for help on using the changeset viewer.