summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2018-02-04 11:13:56 -0800
committerFather Chrysostomos <sprout@cpan.org>2018-02-04 12:22:15 -0800
commit1e2cfe157cae98578de3c274bc64b8ea032b91e0 (patch)
tree5bb3ac642280f7de432b1a234004ce6e0aec7a6d /op.c
parent2ea7b253ec46e8acd1ff2b09220c60eed34cd337 (diff)
downloadperl-1e2cfe157cae98578de3c274bc64b8ea032b91e0.tar.gz
Disable CV-in-stash optimization
outside of the main package. Instead of actually reverting to the previous logic that excluded packages other that main as a side effect of the logic being faulty, this time I am checking for the main package explicitly.
Diffstat (limited to 'op.c')
-rw-r--r--op.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/op.c b/op.c
index 373822a349..c6f228b2e0 100644
--- a/op.c
+++ b/op.c
@@ -9847,9 +9847,12 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs,
Also, we may be called from load_module at run time, so
PL_curstash (which sets CvSTASH) may not point to the stash the
sub is stored in. */
+ /* XXX This optimization is currently disabled for packages other
+ than main, since there was too much CPAN breakage. */
const I32 flags =
ec ? GV_NOADD_NOINIT
: (IN_PERL_RUNTIME && PL_curstash != CopSTASH(PL_curcop))
+ || PL_curstash != PL_defstash
|| memchr(name, ':', namlen) || memchr(name, '\'', namlen)
? gv_fetch_flags
: GV_ADDMULTI | GV_NOINIT | GV_NOTQUAL;