Skip to content

Commit 2a21c53

Browse files
committed
S_doopen_pm - make mortalcopy directly
1 parent ab02cca commit 2a21c53

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
@@ -4407,13 +4407,11 @@ S_doopen_pm(pTHX_ SV *name)
44074407
return NULL;
44084408

44094409
if (memENDPs(p, namelen, ".pm")) {
4410-
SV *const pmcsv = sv_newmortal();
4411-
PerlIO * pmcio;
4410+
SV *const pmcsv = sv_mortalcopy_flags(name, SV_GMAGIC|SV_NOSTEAL|SV_DO_COW_SVSETSV);
44124411

4413-
SvSetSV_nosteal(pmcsv,name);
44144412
sv_catpvs(pmcsv, "c");
44154413

4416-
pmcio = check_type_and_open(pmcsv);
4414+
PerlIO * pmcio = check_type_and_open(pmcsv);
44174415
if (pmcio)
44184416
return pmcio;
44194417
}

0 commit comments

Comments
 (0)