Changeset 15455 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jul 15, 2006, 8:30:03 AM (19 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r15444 r15455 1 2006-07-15 Darin Adler <[email protected]> 2 3 Reviewed by Geoff. 4 5 - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8395 6 <rdar://problem/4613467> 7 REGRESSION: RegEx seems broken for hex escaped non breaking space 8 9 Test: fast/js/regexp-extended-characters-more.html 10 11 * pcre/pcre_exec.c: 12 (match): Got rid of utf16Length local variable to guarantee there's no 13 extra stack usage in recursive calls. Fixed two places in the PCRE_UTF16 14 code that were using the length variable, which is the UTF-8 length of 15 a character in the pattern, to move in the UTF-16 subject string. Instead 16 they hardcode lengths of 1 and 2 since the code already handles BMP 17 characters and surrogate pairs separately. Also fixed some DPRINTF so 18 I could compile with DEBUG on. 19 (pcre_exec): Changed a place that was checking for multibyte characters 20 in the subject string to use ISMIDCHAR. Instead it was using hardcoded 21 logic that was right for UTF-8 but wrong for UTF-16. 22 23 * pcre/pcre_compile.c: (pcre_compile2): Fixed a DPRINTF so I could compile 24 with DEBUG on. 25 1 26 2006-07-14 Geoffrey Garen <[email protected]> 2 27 -
trunk/JavaScriptCore/pcre/pcre_compile.c
r14736 r15455 3996 3996 3997 3997 DPRINTF(("------------------------------------------------------------------\n")); 3998 #if !PCRE_UTF16 3998 3999 DPRINTF(("%s\n", pattern)); 4000 #endif 3999 4001 4000 4002 /* The first thing to do is to make a pass over the pattern to compute the -
trunk/JavaScriptCore/pcre/pcre_exec.c
r14457 r15455 1952 1952 GETUTF8CHARLEN(fc, ecode, length); 1953 1953 { 1954 int utf16Length; /* don't initialize on this line as workaround for Win32 compile problem */ 1955 utf16Length = fc > 0xFFFF ? 2 : 1; 1956 if (min * utf16Length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); 1954 if (min * (fc > 0xFFFF ? 2 : 1) > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); 1957 1955 ecode += length; 1958 1956 1959 if ( utf16Length == 1)1957 if (fc <= 0xFFFF) 1960 1958 { 1961 1959 #ifdef SUPPORT_UCP … … 1991 1989 for (i = min; i < max; i++) 1992 1990 { 1993 if (eptr > md->end_subject - length) break;1991 if (eptr >= md->end_subject) break; 1994 1992 if (*eptr != fc && *eptr != othercase) break; 1995 1993 ++eptr; … … 2039 2037 { 2040 2038 int nc; 2041 if (eptr > md->end_subject - length) break;2039 if (eptr > md->end_subject - 2) break; 2042 2040 GETCHAR(nc, eptr); 2043 2041 if (*eptr != fc) break; … … 2162 2160 maximizing, find the maximum number of characters and work backwards. */ 2163 2161 2162 #if PCRE_UTF16 2163 DPRINTF(("matching %c{%d,%d}\n", fc, min, max)); 2164 #else 2164 2165 DPRINTF(("matching %c{%d,%d} against subject %.*s\n", fc, min, max, 2165 2166 max, eptr)); 2167 #endif 2166 2168 2167 2169 if ((ims & PCRE_CASELESS) != 0) … … 2307 2309 characters and work backwards. */ 2308 2310 2311 #if PCRE_UTF16 2312 DPRINTF(("negative matching %c{%d,%d}\n", fc, min, max)); 2313 #else 2309 2314 DPRINTF(("negative matching %c{%d,%d} against subject %.*s\n", fc, min, max, 2310 2315 max, eptr)); 2316 #endif 2311 2317 2312 2318 if ((ims & PCRE_CASELESS) != 0) … … 3733 3739 #ifdef SUPPORT_UTF8 3734 3740 if (match_block.utf8) 3735 while(start_match < end_subject && (*start_match & 0xc0) == 0x80)3741 while(start_match < end_subject && ISMIDCHAR(*start_match)) 3736 3742 start_match++; 3737 3743 #endif
Note:
See TracChangeset
for help on using the changeset viewer.