Ignore:
Timestamp:
Jul 18, 2007, 5:44:16 PM (18 years ago)
Author:
darin
Message:

JavaScriptCore:

Reviewed by Oliver Hunt.

  • fix <rdar://problem/5345432> PCRE computes length wrong for expressions such as "[]"

Test: fast/js/regexp-charclass-crash.html

  • pcre/pcre_compile.c: (pcre_compile2): Fix the preflight code that calls check_posix_syntax to match the actual regular expression compilation code; before it was missing the check of the first character.

LayoutTests:

Reviewed by Oliver Hunt.

  • test for <rdar://problem/5345432> PCRE computes length wrong for expressions such as "[]"
  • fast/js/regexp-charclass-crash-expected.txt: Added.
  • fast/js/regexp-charclass-crash.html: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/pcre/pcre_compile.c

    r23846 r24430  
    43254325      checked during the real compile phase. */
    43264326
    4327       else if (*ptr == '[' && ptr + 2 < patternEnd && check_posix_syntax(ptr, patternEnd, &ptr, &compile_block))
     4327      else if (*ptr == '[' && ptr + 2 < patternEnd && (ptr[1] == ':' || ptr[1] == '.' || ptr[1] == '=') && check_posix_syntax(ptr, patternEnd, &ptr, &compile_block))
    43284328        {
    43294329        ptr++;
Note: See TracChangeset for help on using the changeset viewer.