Changeset 15455 in webkit for trunk/JavaScriptCore/pcre/pcre_exec.c
- Timestamp:
- Jul 15, 2006, 8:30:03 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.