Skip to content

Commit dbb7e8b

Browse files
committed
pp.c: pp_clonecv reorder TARGs init vs use, universal.c: remove a strlen
dTARGET macro, and macro ARGTARG both deref PL_op. find_runcv() is a fn. Reorder dTARGET to be after the find_runcv() call so the CC dedupes find the OP * with ARGTARG. Remove 2 strlen() calls at proc start inside Perl_boot_core_UNIVERSAL().
1 parent e5ef137 commit dbb7e8b

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

pp.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ PP(pp_introcv)
6262

6363
PP(pp_clonecv)
6464
{
65-
dTARGET;
65+
6666
CV * const protocv = PadnamePROTOCV(
6767
PadlistNAMESARRAY(CvPADLIST(find_runcv(NULL)))[ARGTARG]
6868
);
69-
assert(SvTYPE(TARG) == SVt_PVCV);
7069
assert(protocv);
70+
dTARGET;
71+
assert(SvTYPE(TARG) == SVt_PVCV);
7172
if (CvISXSUB(protocv)) { /* constant */
7273
/* XXX Should we clone it here? */
7374
/* If this changes to use SAVECLEARSV, we can move the SAVECLEARSV

universal.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -1436,8 +1436,10 @@ Perl_boot_core_UNIVERSAL(pTHX)
14361436

14371437
/* Providing a Regexp::DESTROY fixes #21347. See test in t/op/ref.t */
14381438
{
1439-
CV * const cv =
1440-
newCONSTSUB(get_hv("Regexp::", GV_ADD), "DESTROY", NULL);
1439+
GV* const gv = gv_fetchpvs("Regexp::", GV_ADD, SVt_PVHV);
1440+
HV* const stash = GvHV(gv);
1441+
CV* const cv =
1442+
newCONSTSUB_flags(stash, "DESTROY", STRLENs("DESTROY"), 0, NULL);
14411443
char ** cvfile = &CvFILE(cv);
14421444
char * oldfile = *cvfile;
14431445
CvDYNFILE_off(cv);

0 commit comments

Comments
 (0)