summaryrefslogtreecommitdiff
path: root/pp_sort.c
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2017-08-30 22:35:17 +0100
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2017-09-04 10:12:04 +0100
commitf6107ca24b4cf22dcf7fd69d65612ad718c48fca (patch)
tree376e6bd33ed798472b0461bc6fe7ebe70a471608 /pp_sort.c
parentae2cf9f62925677edff191c3f0de1a05a16e4f2f (diff)
downloadperl-f6107ca24b4cf22dcf7fd69d65612ad718c48fca.tar.gz
Strengthen weak refs when sorting in-place
It's conceptually an assignment, which should strengthen any weak refs. Reported-by: Tom Molesworth <team@cpan.org>
Diffstat (limited to 'pp_sort.c')
-rw-r--r--pp_sort.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/pp_sort.c b/pp_sort.c
index ee1dc5dd98..5f39dba40e 100644
--- a/pp_sort.c
+++ b/pp_sort.c
@@ -1769,6 +1769,9 @@ PP(pp_sort)
base[i] = newSVsv(sv);
else
SvREFCNT_inc_simple_void_NN(sv);
+
+ if (SvWEAKREF(sv))
+ sv_rvunweaken(sv);
}
av_clear(av);
if (max > 0) {