diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2017-09-26 23:11:04 +0100 |
---|---|---|
committer | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2017-10-24 14:48:27 +0100 |
commit | 5bad3c4f3a4515aaa622eecdf6f5a84fcaff7ed9 (patch) | |
tree | a129f8376172e3fa1761945d5609ddce9fef1713 /pp.c | |
parent | 199e777d25e184ed0cfa8e4f08a8268d883daf33 (diff) | |
download | perl-5bad3c4f3a4515aaa622eecdf6f5a84fcaff7ed9.tar.gz |
Unweaken refs in in-place reverse
For consistency with assignment and in-place sort
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -5586,7 +5586,14 @@ PP(pp_reverse) SV * const tmp = *begin; *begin++ = *end; *end-- = tmp; + + if (tmp && SvWEAKREF(tmp)) + sv_rvunweaken(tmp); } + + /* make sure we catch the middle element */ + if (begin == end && *begin && SvWEAKREF(*begin)) + sv_rvunweaken(*begin); } } } |