Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pp.c: pp_clonecv reorder TARGs init vs use, universal.c: remove a strlen #23162

Open
wants to merge 1 commit into
base: blead
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pp.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ PP(pp_introcv)

PP(pp_clonecv)
{
dTARGET;

CV * const protocv = PadnamePROTOCV(
PadlistNAMESARRAY(CvPADLIST(find_runcv(NULL)))[ARGTARG]
);
assert(SvTYPE(TARG) == SVt_PVCV);
assert(protocv);
dTARGET;
assert(SvTYPE(TARG) == SVt_PVCV);
if (CvISXSUB(protocv)) { /* constant */
/* XXX Should we clone it here? */
/* If this changes to use SAVECLEARSV, we can move the SAVECLEARSV
Expand Down
6 changes: 4 additions & 2 deletions universal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1436,8 +1436,10 @@ Perl_boot_core_UNIVERSAL(pTHX)

/* Providing a Regexp::DESTROY fixes #21347. See test in t/op/ref.t */
{
CV * const cv =
newCONSTSUB(get_hv("Regexp::", GV_ADD), "DESTROY", NULL);
GV* const gv = gv_fetchpvs("Regexp::", GV_ADD, SVt_PVHV);
HV* const stash = GvHV(gv);
CV* const cv =
newCONSTSUB_flags(stash, "DESTROY", STRLENs("DESTROY"), 0, NULL);
char ** cvfile = &CvFILE(cv);
char * oldfile = *cvfile;
CvDYNFILE_off(cv);
Expand Down
Loading