Reviewed by Eric.
[WebKit-https.git] / JavaScriptCore / pcre / pcre_compile.cpp
index 72f995b..b21706f 100644 (file)
@@ -869,8 +869,10 @@ compile_branch(int options, int* brackets, uschar** codeptr,
                 
                 /* If the first character is '^', set the negation flag and skip it. */
 
-                if (ptr + 1 >= patternEnd)
-                    return -1;
+                if (ptr + 1 >= patternEnd) {
+                    *errorcodeptr = ERR6;
+                    return false;
+                }
 
                 if (ptr[1] == '^') {
                     negate_class = true;