summaryrefslogtreecommitdiff
path: root/pad.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-09-10 20:29:19 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-09-15 06:19:33 -0700
commite52eb89d6b6e33611c38ec4ef278fd23c7109640 (patch)
treec5c3e8bfea9e2e9060c20a17b4707d801db91a64 /pad.c
parent00efeabe1829ee5b5c8a75bc7f7989900f19af24 (diff)
downloadperl-e52eb89d6b6e33611c38ec4ef278fd23c7109640.tar.gz
Avoid reifying GVs in rv2cv
\&foo no longer reifies GVs in the stash: $ ./miniperl -e 'sub foo{} warn $::{foo}; \&foo; warn $::{foo}' CODE(0x7fab6282ad98) at -e line 1. CODE(0x7fab6282ad98) at -e line 1. Sub calls still reify them though, because of the way ck_subr cur- rently works. Constant proxies are still upgraded to full GVs for now, just to mini- mise the churn per patch. This makes it possible for OP_GVs to point to things other than GVs, and these things are stored in the pad under threads. Hence, pad_tidy could turn on PADTMP, and then IS_PADGV becomes true when it is upgraded to a glob, so refgen will fail assertions. There is actually no need to turn on PADTMP in pad_tidy, since it will already be on for op targets. (We need to get rid of IS_PADGV one of these days. It doesn’t actually do anything.)
Diffstat (limited to 'pad.c')
-rw-r--r--pad.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/pad.c b/pad.c
index 285c2043c3..eb42ab8622 100644
--- a/pad.c
+++ b/pad.c
@@ -1794,9 +1794,7 @@ Perl_pad_tidy(pTHX_ padtidy_type type)
if (!PL_curpad[ix] || SvIMMORTAL(PL_curpad[ix])
|| IS_PADGV(PL_curpad[ix]) || IS_PADCONST(PL_curpad[ix]))
continue;
- if (!SvPADMY(PL_curpad[ix])) {
- SvPADTMP_on(PL_curpad[ix]);
- } else if (!SvFAKE(namep[ix])) {
+ if (SvPADMY(PL_curpad[ix]) && !SvFAKE(namep[ix])) {
/* This is a work around for how the current implementation of
?{ } blocks in regexps interacts with lexicals.