Skip to content

Commit 4bc1619

Browse files
committed
sv_clear: with zero SvREFCNT, call sv_free2, not sv_free
Towards the bottom of `Perl_sv_clear`, there is a region described as being `* unrolled SvREFCNT_dec and sv_free2 follows: */`. This was originally accurate when introduced in 5239d5c but the definitions of `Perl_sv_free`, `Perl_sv_free2`, and `SvREFCNT_dec` were updated in 75a9bf9 and this region of code didn't get updated to match. I'm unsure of how to best refactor this code region, but right now the call to `sv_free(sv)` ultimately boils down to a call to `sv_free2`, so this commit just goes there directly.
1 parent 00f06a3 commit 4bc1619

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7125,7 +7125,7 @@ Perl_sv_clear(pTHX_ SV *const orig_sv)
71257125
if (!sv)
71267126
continue;
71277127
if (!SvREFCNT(sv)) {
7128-
sv_free(sv);
7128+
Perl_sv_free2(aTHX_ sv, 0);
71297129
continue;
71307130
}
71317131
if (--(SvREFCNT(sv)))

0 commit comments

Comments
 (0)