Skip to content

Commit 3777a0a

Browse files
richardleachkhwilliamson
authored andcommitted
pp_split: reify using NULL rather than PL_sv_undef (gh#18077)
1 parent 65ac759 commit 3777a0a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

pp.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6045,11 +6045,15 @@ PP(pp_split)
60456045
}
60466046
else {
60476047
if (!AvREAL(ary)) {
6048-
I32 i;
60496048
AvREAL_on(ary);
60506049
AvREIFY_off(ary);
6051-
for (i = AvFILLp(ary); i >= 0; i--)
6052-
AvARRAY(ary)[i] = &PL_sv_undef; /* don't free mere refs */
6050+
6051+
/* Note: the above av_clear(ary) above should */
6052+
/* have set AvFILLp(ary) = -1, so this Zero() */
6053+
/* may well be superfluous. */
6054+
6055+
/* don't free mere refs */
6056+
Zero(AvARRAY(ary), AvFILLp(ary) + 1, SV*);
60536057
}
60546058
/* temporarily switch stacks */
60556059
SAVESWITCHSTACK(PL_curstack, ary);

0 commit comments

Comments
 (0)