diff options
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -552,6 +552,13 @@ Perl_fbm_compile(pTHX_ SV *sv, U32 flags) PERL_ARGS_ASSERT_FBM_COMPILE; + /* Refuse to fbm_compile a studied scalar, as this gives more flexibility in + SV flag usage. No real-world code would ever end up using a studied + scalar as a compile-time second argument to index, so this isn't a real + pessimisation. */ + if (SvSCREAM(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() */ |