[webkit-changes] cvs commit: JavaScriptCore/pcre pcre.c
Geoffrey
ggaren at opensource.apple.com
Sat Nov 5 21:07:50 PST 2005
ggaren 05/11/05 21:07:50
Modified: . Tag: Ti-2005-009-branch ChangeLog
pcre Tag: Ti-2005-009-branch pcre.c
Log:
- Rolled out the pcre changes in my previous checkin because I
applied them to the wrong branch.
Reviewed by TimH.
* pcre/pcre.c:
(compile_branch):
Revision Changes Path
No revision
No revision
1.677.6.34.2.14.2.5 +10 -0 JavaScriptCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/JavaScriptCore/ChangeLog,v
retrieving revision 1.677.6.34.2.14.2.4
retrieving revision 1.677.6.34.2.14.2.5
diff -u -r1.677.6.34.2.14.2.4 -r1.677.6.34.2.14.2.5
--- ChangeLog 6 Nov 2005 04:09:42 -0000 1.677.6.34.2.14.2.4
+++ ChangeLog 6 Nov 2005 05:07:45 -0000 1.677.6.34.2.14.2.5
@@ -1,3 +1,13 @@
+2005-11-05 Geoffrey Garen <ggaren at apple.com>
+
+ - Rolled out the pcre changes in my previous checkin because I
+ applied them to the wrong branch.
+
+ Reviewed by TimH.
+
+ * pcre/pcre.c:
+ (compile_branch):
+
2005-11-04 Geoffrey Garen <ggaren at apple.com>
Reviewed by Darin.
No revision
No revision
1.3.12.2.4.3 +31 -17 JavaScriptCore/pcre/Attic/pcre.c
Index: pcre.c
===================================================================
RCS file: /cvs/root/JavaScriptCore/pcre/Attic/pcre.c,v
retrieving revision 1.3.12.2.4.2
retrieving revision 1.3.12.2.4.3
diff -u -r1.3.12.2.4.2 -r1.3.12.2.4.3
--- pcre.c 6 Nov 2005 04:05:47 -0000 1.3.12.2.4.2
+++ pcre.c 6 Nov 2005 05:07:49 -0000 1.3.12.2.4.3
@@ -1190,6 +1190,13 @@
*errorptr = ERR6;
goto FAILED;
}
+#if PCRE_UTF16
+ if (c > 255)
+ {
+ *errorptr = ERR33;
+ goto FAILED;
+ }
+#endif
/* Handle POSIX class names. Perl allows a negation extension of the
form [:^name]. A square bracket that doesn't match the syntax is
@@ -1299,7 +1306,16 @@
}
}
- /* Fall through if single character. */
+ /* Fall through if single character, but don't at present allow
+ chars > 255 in UTF-8 mode. */
+
+#ifdef SUPPORT_UTF8
+ if (c > 255)
+ {
+ *errorptr = ERR33;
+ goto FAILED;
+ }
+#endif
}
/* A single character may be followed by '-' to form a range. However,
@@ -1317,6 +1333,13 @@
*errorptr = ERR6;
goto FAILED;
}
+#if PCRE_UTF16
+ if (d > 255)
+ {
+ *errorptr = ERR33;
+ goto FAILED;
+ }
+#endif
/* The second part of a range can be a single-character escape, but
not any of the other escapes. Perl 5.6 treats a hyphen as a literal
@@ -1327,6 +1350,13 @@
const ichar *oldptr = ptr;
d = check_escape(&ptr, errorptr, *brackets, options, TRUE, cd);
+#ifdef SUPPORT_UTF8
+ if (d > 255)
+ {
+ *errorptr = ERR33;
+ goto FAILED;
+ }
+#endif
/* \b is backslash; any other special means the '-' was literal */
if (d < 0)
@@ -1345,16 +1375,6 @@
goto FAILED;
}
-#ifdef SUPPORT_UTF8
- /* start of character range is out of range -- skip range */
- if (c > 255)
- continue;
-
- /* end of character range is out of range -- truncate range */
- if (d > 255)
- d = 255;
-#endif
-
for (; c <= d; c++)
{
class[c/8] |= (1 << (c&7));
@@ -1374,12 +1394,6 @@
SINGLE_CHARACTER:
-#ifdef SUPPORT_UTF8
- /* character is out of range -- skip it */
- if (c > 255)
- continue;
-#endif
-
class [c/8] |= (1 << (c&7));
if ((options & PCRE_CASELESS) != 0)
{
More information about the webkit-changes
mailing list