Skip to content

Commit a634b79

Browse files
maukehaarg
authored andcommitted
Revert "op.c: re-enable coderef-in-stash optimization"
This reverts commit b9eeeef.
1 parent 907b053 commit a634b79

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

op.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11061,9 +11061,12 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs,
1106111061
Also, we may be called from load_module at run time, so
1106211062
PL_curstash (which sets CvSTASH) may not point to the stash the
1106311063
sub is stored in. */
11064+
/* XXX This optimization is currently disabled for packages other
11065+
than main, since there was too much CPAN breakage. */
1106411066
const I32 flags =
1106511067
ec ? GV_NOADD_NOINIT
1106611068
: (IN_PERL_RUNTIME && PL_curstash != CopSTASH(PL_curcop))
11069+
|| PL_curstash != PL_defstash
1106711070
|| memchr(name, ':', namlen) || memchr(name, '\'', namlen)
1106811071
? gv_fetch_flags
1106911072
: GV_ADDMULTI | GV_NOINIT | GV_NOTQUAL;

t/op/sub.t

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,10 @@ is ref($main::{rt_129916}), 'CODE', 'simple sub stored as CV in stash (main::)';
398398
package RT129916;
399399
sub foo { 42 }
400400
}
401-
is ref($RT129916::{foo}), 'CODE', 'simple sub stored as CV in stash (non-main::)';
401+
{
402+
local $::TODO = "disabled for now";
403+
is ref($RT129916::{foo}), 'CODE', 'simple sub stored as CV in stash (non-main::)';
404+
}
402405

403406
# Calling xsub via ampersand syntax when @_ has holes
404407
SKIP: {

0 commit comments

Comments
 (0)