This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
S_setup_longest(): SvTAIL() used where always 0
authorDavid Mitchell <davem@iabyn.com>
Sat, 12 Nov 2016 11:02:24 +0000 (11:02 +0000)
committerDavid Mitchell <davem@iabyn.com>
Sat, 12 Nov 2016 16:15:09 +0000 (16:15 +0000)
SvTAIL() isn't set on an SV until fbm_compile() has been called,
so there's no point testing it before calling fbm_compile()

regcomp.c

index e9c7972..ac66432 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -6677,7 +6677,11 @@ S_setup_longest(pTHX_ RExC_state_t *pRExC_state, SV* sv_longest,
         calculate it.*/
     ml = minlen ? *(minlen) : (SSize_t)longest_length;
     *rx_end_shift = ml - offset
-        - longest_length + (SvTAIL(sv_longest) != 0)
+        - longest_length
+            /* XXX SvTAIL is always false here - did you mean FBMcf_TAIL
+             * intead? - DAPM
+            + (SvTAIL(sv_longest) != 0)
+            */
         + lookbehind;
 
     t = (eol/* Can't have SEOL and MULTI */