Skip to content

Commit 826062d

Browse files
committed
S_doopen_pm - make mortalcopy directly
1 parent b729fb3 commit 826062d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

pp_ctl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4415,13 +4415,11 @@ S_doopen_pm(pTHX_ SV *name)
44154415
return NULL;
44164416

44174417
if (memENDPs(p, namelen, ".pm")) {
4418-
SV *const pmcsv = sv_newmortal();
4419-
PerlIO * pmcio;
4418+
SV *const pmcsv = sv_mortalcopy_flags(name, SV_GMAGIC|SV_NOSTEAL|SV_DO_COW_SVSETSV);
44204419

4421-
SvSetSV_nosteal(pmcsv,name);
44224420
sv_catpvs(pmcsv, "c");
44234421

4424-
pmcio = check_type_and_open(pmcsv);
4422+
PerlIO * pmcio = check_type_and_open(pmcsv);
44254423
if (pmcio)
44264424
return pmcio;
44274425
}

0 commit comments

Comments
 (0)