re_intuit_start(): update comments in BmUSEFUL blk
authorDavid Mitchell <davem@iabyn.com>
Sun, 16 Mar 2014 12:17:18 +0000 (12:17 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sun, 16 Mar 2014 18:03:50 +0000 (18:03 +0000)
regexec.c

index c77f5b3..022b52b 100644 (file)
--- a/regexec.c
+++ b/regexec.c
@@ -1348,11 +1348,11 @@ Perl_re_intuit_start(pTHX_
        ++BmUSEFUL(utf8_target ? prog->check_utf8 : prog->check_substr);        /* hooray/5 */
     }
     else {
-       /* The found string does not prohibit matching at strpos,
-          - no optimization of calling REx engine can be performed,
-          unless it was an MBOL and we are not after MBOL,
-          or a future STCLASS check will fail this. */
-       if (!(prog->intflags & PREGf_NAUGHTY)   /* XXXX If strpos moved? */
+        /* The found rx_origin position does not prohibit matching at
+         * strpos, so calling intuit didn't gain us anything. Decrement
+         * the BmUSEFUL() count on the check substring, and if we reach
+         * zero, free it.  */
+       if (!(prog->intflags & PREGf_NAUGHTY)
            && (utf8_target ? (
                prog->check_utf8                /* Could be deleted already */
                && --BmUSEFUL(prog->check_utf8) < 0
@@ -1402,6 +1402,7 @@ Perl_re_intuit_start(pTHX_
     return NULL;
 }
 
+
 #define DECL_TRIE_TYPE(scan) \
     const enum { trie_plain, trie_utf8, trie_utf8_fold, trie_latin_utf8_fold, \
                  trie_utf8_exactfa_fold, trie_latin_utf8_exactfa_fold } \