Ignore:
Timestamp:
Dec 4, 2007, 11:08:28 AM (18 years ago)
Author:
Darin Adler
Message:

JavaScriptCore:

Reviewed by Geoff.

Test: fast/js/regexp-overflow.html

  • pcre/pcre_compile.cpp: (calculateCompiledPatternLengthAndFlags): Add room for the additional BRA/KET that was generated in the compile code but not taken into account here.

LayoutTests:

Reviewed by Geoff.

  • 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

    r28058 r28395  
    11description(
    2 'Tests some regular expressions with braces in them that used to overflow the regular expression compilation preflight computation.'
     2'Tests some regular expressions that used to overflow the regular expression compilation preflight computation.'
    33);
    44
    55shouldBe('/(\\d)(\\1{1})/.exec("11").toString()', '"11,1,1"');
     6
    67shouldBe('/^(\\d{1,2})([ -:\\/\\.]{1})(\\d{1,2})(\\2{1})?(\\d{2,4})?$/.exec("1:1").toString()', '"1:1,1,:,1,,"');
    7 shouldBe('/^(\\d{4})([ -:\\/\\.]{1})(\\d{1,2})(\\2{1})(\\d{1,2})T(\\d{1,2})([ -:\\/\\.]{1})(\\d{1,2})(\\7{1})(\\d{1,2})Z$/.exec("1234:5:6T7/8/9Z").toString()', '"1234:5:6T7/8/9Z,1234,:,5,:,6,7,/,8,/,9"');
     8
     9shouldBe('/^(\\d{4})([ -:\\/\\.]{1})(\\d{1,2})(\\2{1})(\\d{1,2})T(\\d{1,2})([ -:\\/\\.]{1})(\\d{1,2})(\\7{1})(\\d{1,2})Z$/.exec("1234:5:6T7/8/9Z").toString()',
     10    '"1234:5:6T7/8/9Z,1234,:,5,:,6,7,/,8,/,9"');
     11
     12shouldBe('/\\[["\'\\s]{0,1}([\\w-]*)["\'\\s]{0,1}([\\W]{0,1}=){0,2}["\'\\s]{0,1}([\\w-]*)["\'\\s]{0,1}\\]$/.exec("[]").toString()',
     13    '"[],,,"');
     14
     15shouldBe('/(x){0,2}/.exec("").toString()', '","');
    816
    917debug('');
Note: See TracChangeset for help on using the changeset viewer.