[perl/f16] Stop !$^V from leaking
Petr Pisar
ppisar at fedoraproject.org
Tue Feb 7 16:09:01 UTC 2012
commit 1c4dbc1dc76727565300d03af6067e399b76f481
Author: Petr Písař <ppisar at redhat.com>
Date: Mon Feb 6 16:05:19 2012 +0100
Stop !$^V from leaking
perl-5.14.2-Stop-V-from-leaking.patch | 54 +++++++++++++++++++++++++++++++++
perl.spec | 6 ++++
2 files changed, 60 insertions(+), 0 deletions(-)
---
diff --git a/perl-5.14.2-Stop-V-from-leaking.patch b/perl-5.14.2-Stop-V-from-leaking.patch
new file mode 100644
index 0000000..c8ac0d9
--- /dev/null
+++ b/perl-5.14.2-Stop-V-from-leaking.patch
@@ -0,0 +1,54 @@
+From 8ee4f541d4632a3615e70e177e004c5db970c8cd Mon Sep 17 00:00:00 2001
+From: Father Chrysostomos <sprout at cpan.org>
+Date: Fri, 3 Feb 2012 21:55:31 -0800
+Subject: [PATCH] Stop !$^V from leaking
+
+by mortalising the temporary SVs.
+
+Petr Pisar: Back-port for 5.14.2.
+---
+ t/op/svleak.t | 4 +++-
+ universal.c | 8 +++++++-
+ 2 files changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/t/op/svleak.t b/t/op/svleak.t
+index 5eb090c..0f4348e 100644
+--- a/t/op/svleak.t
++++ b/t/op/svleak.t
+@@ -13,7 +13,7 @@ BEGIN {
+ or skip_all("XS::APItest not available");
+ }
+
+-plan tests => 19;
++plan tests => 20;
+
+ # run some code N times. If the number of SVs at the end of loop N is
+ # greater than (N-1)*delta at the end of loop 1, we've got a leak
+@@ -141,3 +141,5 @@ leak(2, 0,
+ },
+ "rcatline leak"
+ );
++
++leak(2,0,sub { !$^V }, '[perl #109762] version object in boolean context');
+diff --git a/universal.c b/universal.c
+index 092ee80..9615d59 100644
+--- a/universal.c
++++ b/universal.c
+@@ -544,7 +544,13 @@ XS(XS_version_boolean)
+ SP -= items;
+ if (sv_derived_from(ST(0), "version") && SvROK(ST(0))) {
+ SV * const lobj = SvRV(ST(0));
+- SV * const rs = newSViv( vcmp(lobj,new_version(newSVpvs("0"))) );
++ SV * const rs =
++ newSViv( vcmp(lobj,
++ sv_2mortal(new_version(
++ sv_2mortal(newSVpvs("0"))
++ ))
++ )
++ );
+ mPUSHs(rs);
+ PUTBACK;
+ return;
+--
+1.7.7.6
+
diff --git a/perl.spec b/perl.spec
index 83ed425..7b3ca54 100644
--- a/perl.spec
+++ b/perl.spec
@@ -90,6 +90,9 @@ Patch13: perl-5.14.2-locale-search-inc.patch
# rhbz#771228, RT#107216, fixed after 5.15.6.
Patch14: perl-5.14.2-Signal-handlers-must-run-before-sigsuspend-returns.patch
+# Stop !$^V from leaking, rhbz#787613, RT#109762, fixed after 5.15.7.
+Patch15: perl-5.14.2-Stop-V-from-leaking.patch
+
# Update some of the bundled modules
# see http://fedoraproject.org/wiki/Perl/perl.spec for instructions
@@ -1137,6 +1140,7 @@ tarball from perl.org.
%patch12 -p1
%patch13 -p1
%patch14 -p1
+%patch15 -p1
#copy the example script
cp -a %{SOURCE5} .
@@ -1332,6 +1336,7 @@ pushd %{build_archlib}/CORE/
'Fedora Patch12: Fix interrupted reading' \
'Fedora Patch13: Fix searching for Unicode::Collate::Locale data' \
'Fedora Patch14: Run signal handlers before returning from sigsuspend' \
+ 'Fedora Patch15: Stop !$^V from leaking' \
%{nil}
rm patchlevel.bak
@@ -2216,6 +2221,7 @@ sed \
- Run safe signal handlers before returning from sigsuspend() and pause()
(bug #771228)
- Correct perl-Scalar-List-Utils files list
+- Stop !$^V from leaking (bug #787613)
* Thu Feb 02 2012 Petr Šabata <contyk at redhat.com> - 4:5.14.2-194
- Sub-package Socket for IO::Socket::IP
More information about the scm-commits
mailing list