diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-18 10:49:43 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-11 09:40:02 +0200 |
commit | 9402563ac1ee6a7649763b93342cb2940addf915 (patch) | |
tree | 3f35069eb1363ff7c030a9a13d994dc365e1a448 /util.c | |
parent | 21aeb718e9b2ffc24ed853a11c571efa7fc3555d (diff) | |
download | perl-9402563ac1ee6a7649763b93342cb2940addf915.tar.gz |
Exit early from Perl_fbm_compile() if the SV is already "compiled".
I believe that this can only happen if a constant subroutine is used more than
once as the second argument to index.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -559,6 +559,9 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags) if (SvSCREAM(sv)) return; + if (SvVALID(sv)) + return; + if (flags & FBMcf_TAIL) { MAGIC * const mg = SvUTF8(sv) && SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_utf8) : NULL; sv_catpvs(sv, "\n"); /* Taken into account in fbm_instr() */ |