Skip to content

Commit 99c2d70

Browse files
committed
S_doopen_pm - make mortalcopy directly
1 parent aa7ef55 commit 99c2d70

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
@@ -4418,13 +4418,11 @@ S_doopen_pm(pTHX_ SV *name)
44184418
return NULL;
44194419

44204420
if (memENDPs(p, namelen, ".pm")) {
4421-
SV *const pmcsv = sv_newmortal();
4422-
PerlIO * pmcio;
4421+
SV *const pmcsv = sv_mortalcopy_flags(name, SV_GMAGIC|SV_NOSTEAL|SV_DO_COW_SVSETSV);
44234422

4424-
SvSetSV_nosteal(pmcsv,name);
44254423
sv_catpvs(pmcsv, "c");
44264424

4427-
pmcio = check_type_and_open(pmcsv);
4425+
PerlIO * pmcio = check_type_and_open(pmcsv);
44284426
if (pmcio)
44294427
return pmcio;
44304428
}

0 commit comments

Comments
 (0)