2007-11-26 Eric Seidel <eric@webkit.org>
authoreric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 11:35:37 +0000 (11:35 +0000)
committereric@webkit.org <eric@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Nov 2007 11:35:37 +0000 (11:35 +0000)
        Reviewed by Oliver.

        Deprecate jsRegExpExecute's offset-vector fallback code

        * pcre/pcre_exec.cpp:
        (jsRegExpExecute):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28179 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/pcre/pcre_exec.cpp

index 2dd0dba9f52a3e06def66fcca87567a544326e29..d55503c26cd7a26205851947c4acc6170248cae1 100644 (file)
         * pcre/pcre_exec.cpp:
         (match):
 
+2007-11-26  Eric Seidel  <eric@webkit.org>
+
+        Reviewed by Oliver.
+
+        Deprecate jsRegExpExecute's offset-vector fallback code
+
+        * pcre/pcre_exec.cpp:
+        (jsRegExpExecute):
+
 2007-11-26  Eric Seidel  <eric@webkit.org>
 
         Reviewed by Maciej.
index f949a4b1c475366c2070a38c5dccca164af2fd96..5421ddf07711d90aa00a1b5995b936d69bdaa70c 100644 (file)
@@ -1995,6 +1995,9 @@ int jsRegExpExecute(const JSRegExp* re,
     
     int ocount = offsetcount - (offsetcount % 3);
     
+    // FIXME: This is lame that we have to second-guess our caller here.
+    // The API should change to either fail-hard when we don't have enough offset space
+    // or that we shouldn't ask our callers to pre-allocate in the first place.
     bool using_temporary_offsets = false;
     if (re->top_backref > 0 && re->top_backref >= ocount/3) {
         ocount = re->top_backref * 3 + 3;
@@ -2002,6 +2005,7 @@ int jsRegExpExecute(const JSRegExp* re,
         if (!match_block.offset_vector)
             return JSRegExpErrorNoMemory;
         using_temporary_offsets = true;
+        ASSERT_NOT_REACHED(); // Fail debug builds -- No one should be hitting this vestigal (slow!) code, see comment above.
     } else
         match_block.offset_vector = offsets;