From d96402565ccd7459d3a8bc4074f177d00bbefeeb Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sun, 29 Oct 2017 11:21:45 -0700 Subject: [PATCH] Revert "Temporarily revert CV-in-stash optimisation" This reverts commit 6eed25e2537643b77650cb3e4514ec9dc2e97d74. --- op.c | 2 +- t/op/sub.t | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/op.c b/op.c index c61bfd08deb1..368f9b146e62 100644 --- a/op.c +++ b/op.c @@ -9617,7 +9617,7 @@ Perl_newATTRSUB_x(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, sub is stored in. */ const I32 flags = ec ? GV_NOADD_NOINIT - : PL_curstash != CopSTASH(PL_curcop) + : (IN_PERL_RUNTIME && PL_curstash != CopSTASH(PL_curcop)) || memchr(name, ':', namlen) || memchr(name, '\'', namlen) ? gv_fetch_flags : GV_ADDMULTI | GV_NOINIT | GV_NOTQUAL; diff --git a/t/op/sub.t b/t/op/sub.t index 5c501b181ee5..f73abb455f4f 100644 --- a/t/op/sub.t +++ b/t/op/sub.t @@ -423,7 +423,6 @@ is ref($main::{rt_129916}), 'CODE', 'simple sub stored as CV in stash (main::)'; sub foo { 42 } } { - local $TODO = "CV symbol table optimization only works in main:: [perl #129916]"; is ref($RT129916::{foo}), 'CODE', 'simple sub stored as CV in stash (non-main::)'; }