This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
valgrind and /#/x
[perl5.git] / regcomp.c
index dedcd00..556922a 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -4285,7 +4285,8 @@ S_nextchar(pTHX_ RExC_state_t *pRExC_state)
            else if (*RExC_parse == '#') {
                while (*RExC_parse && *RExC_parse != '\n')
                    RExC_parse++;
-               RExC_parse++;
+               if (*RExC_parse)
+                   RExC_parse++;
                continue;
            }
        }