summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-12-07 18:28:46 -0800
committerFather Chrysostomos <sprout@cpan.org>2010-12-07 18:28:46 -0800
commitec192197b904194f8a514368e774522e9b83add8 (patch)
tree6cf2d32e4e27d06db662cfaad427fa3545ac431a /op.c
parent558b442404962caba5a81ad5b785fef3cf5eac5d (diff)
downloadperl-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.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/op.c b/op.c
index 469a008c8e..13462d107b 100644
--- a/op.c
+++ b/op.c
@@ -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)) {