diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-12-07 18:28:46 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-12-07 18:28:46 -0800 |
commit | ec192197b904194f8a514368e774522e9b83add8 (patch) | |
tree | 6cf2d32e4e27d06db662cfaad427fa3545ac431a /op.c | |
parent | 558b442404962caba5a81ad5b785fef3cf5eac5d (diff) | |
download | perl-ec192197b904194f8a514368e774522e9b83add8.tar.gz |
Avoid setting PL_cv_has_eval unnecessarily
Quoting op.c:
/* /$x/ may cause an eval, since $x might be qr/(?{..})/ */
But the (?{..})’s compilation is only ever reached in the scope of
‘use re 'eval'’, so we can avoid setting PL_cv_has_eval (and the
slight overhead that entails) when that pragma is off.
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3930,7 +3930,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg) rcop->op_targ = pad_alloc(rcop->op_type, SVs_PADTMP); /* /$x/ may cause an eval, since $x might be qr/(?{..})/ */ - PL_cv_has_eval = 1; + if (PL_hints & HINT_RE_EVAL) PL_cv_has_eval = 1; /* establish postfix order */ if (pm->op_pmflags & PMf_KEEP || !(PL_hints & HINT_RE_EVAL)) { |