Ignore:
Timestamp:
Mar 27, 2008, 11:41:17 PM (17 years ago)
Author:
[email protected]
Message:

2008-03-27 Darin Adler <Darin Adler>

Reviewed by Mark Rowe.

<rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
compiled length calculated incorrectly.

  • pcre/pcre_compile.cpp: (multiplyWithOverflowCheck): (calculateCompiledPatternLength): Check for overflow when dealing with nested repetition counts and bail with an error rather than returning incorrect results.

2008-03-27 Mark Rowe <[email protected]>

Reviewed by Adam Roben.

Tests for <rdar://problem/5826236> Regular expressions with large nested repetition counts can have their
compiled length calculated incorrectly.

  • fast/js/regexp-overflow-expected.txt:
  • fast/js/resources/regexp-overflow.js:
File:
1 edited

Legend:

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

    r28785 r31388  
    2121shouldBe('/|[x\\B-\\u00b5]/i.exec("").toString()', '""');
    2222
     23var s = "a";
     24for (var i = 0; i < 17; i++)
     25    s += s;
     26
     27shouldThrow('new RegExp(s);');
     28
     29shouldThrow('/(([ab]){30}){3360}/');
     30shouldThrow('/(([ab]){30}){0,3360}/');
     31shouldThrow('/(([ab]){30}){10,3360}/');
     32shouldThrow('/(([ab]){0,30}){3360}/');
     33shouldThrow('/(([ab]){0,30}){0,3360}/');
     34shouldThrow('/(([ab]){0,30}){10,3360}/');
     35shouldThrow('/(([ab]){10,30}){3360}/');
     36shouldThrow('/(([ab]){10,30}){0,3360}/');
     37shouldThrow('/(([ab]){10,30}){10,3360}/');
     38shouldThrow('/(([ab]){12})(([ab]){65535}){1680}(([ab]){38}){722}([ab]){27}/');
     39
    2340debug('');
    2441
Note: See TracChangeset for help on using the changeset viewer.