r62411 - in /branches/upstream/libsub-name-perl/current: Changes MANIFEST MANIFEST.SKIP META.yml Name.xs lib/Sub/Name.pm t/RT42725_deparse.t
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Wed Sep 8 15:32:57 UTC 2010
Author: ansgar-guest
Date: Wed Sep 8 15:32:45 2010
New Revision: 62411
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62411
Log:
[svn-upgrade] new version libsub-name-perl (0.05)
Added:
branches/upstream/libsub-name-perl/current/MANIFEST.SKIP
branches/upstream/libsub-name-perl/current/t/RT42725_deparse.t
Modified:
branches/upstream/libsub-name-perl/current/Changes
branches/upstream/libsub-name-perl/current/MANIFEST
branches/upstream/libsub-name-perl/current/META.yml
branches/upstream/libsub-name-perl/current/Name.xs
branches/upstream/libsub-name-perl/current/lib/Sub/Name.pm
Modified: branches/upstream/libsub-name-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsub-name-perl/current/Changes?rev=62411&op=diff
==============================================================================
--- branches/upstream/libsub-name-perl/current/Changes (original)
+++ branches/upstream/libsub-name-perl/current/Changes Wed Sep 8 15:32:45 2010
@@ -1,3 +1,11 @@
+0.05 -- Wed Sep 8 00:51 CEST 2010
+ * Stop using the padlist to refcount GVs. Instead use regular magic. This
+ allows various modules, including B::Deparse, to safely peek into pads of
+ (re)named subs (Closes RT#42725) (Goro Fuji).
+ * Support perl >= 5.13.3 by using the new CvGV_set interface there
+ (Closes RT#59558).
+ * Stop using the deprecated PL_no_symref (Closes RT#57843).
+
0.04 -- Fri Jul 18 15:23 CEST 2008
* Fixed for perl 5.6 and 5.005 threads (tested)
Modified: branches/upstream/libsub-name-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsub-name-perl/current/MANIFEST?rev=62411&op=diff
==============================================================================
--- branches/upstream/libsub-name-perl/current/MANIFEST (original)
+++ branches/upstream/libsub-name-perl/current/MANIFEST Wed Sep 8 15:32:45 2010
@@ -1,8 +1,10 @@
Changes
-MANIFEST
-META.yml
+lib/Sub/Name.pm
Makefile.PL
+MANIFEST This list of files
+MANIFEST.SKIP
Name.xs
README
-lib/Sub/Name.pm
+t/RT42725_deparse.t
t/smoke.t
+META.yml Module meta-data (added by MakeMaker)
Added: branches/upstream/libsub-name-perl/current/MANIFEST.SKIP
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsub-name-perl/current/MANIFEST.SKIP?rev=62411&op=file
==============================================================================
--- branches/upstream/libsub-name-perl/current/MANIFEST.SKIP (added)
+++ branches/upstream/libsub-name-perl/current/MANIFEST.SKIP Wed Sep 8 15:32:45 2010
@@ -1,0 +1,8 @@
+^\.
+build\b
+blib\b
+\.(?:bak|o|c|bs)$
+^Makefile$
+^Makefile.old$
+^Debian
+^Sub-Name-
Modified: branches/upstream/libsub-name-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsub-name-perl/current/META.yml?rev=62411&op=diff
==============================================================================
--- branches/upstream/libsub-name-perl/current/META.yml (original)
+++ branches/upstream/libsub-name-perl/current/META.yml Wed Sep 8 15:32:45 2010
@@ -1,13 +1,21 @@
--- #YAML:1.0
-name: Sub-Name
-version: 0.04
-abstract: (re)name a sub
-license: ~
-author:
+name: Sub-Name
+version: 0.05
+abstract: (re)name a sub
+author:
- Matthijs van Duin <xmath at cpan.org>
-generated_by: ExtUtils::MakeMaker version 6.42
-distribution_type: module
-requires:
+license: unknown
+distribution_type: module
+configure_requires:
+ ExtUtils::MakeMaker: 0
+build_requires:
+ ExtUtils::MakeMaker: 0
+requires: {}
+no_index:
+ directory:
+ - t
+ - inc
+generated_by: ExtUtils::MakeMaker version 6.56
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.3.html
- version: 1.3
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
Modified: branches/upstream/libsub-name-perl/current/Name.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsub-name-perl/current/Name.xs?rev=62411&op=diff
==============================================================================
--- branches/upstream/libsub-name-perl/current/Name.xs (original)
+++ branches/upstream/libsub-name-perl/current/Name.xs Wed Sep 8 15:32:45 2010
@@ -1,5 +1,5 @@
/* Copyright (C) 2004, 2008 Matthijs van Duin. All rights reserved.
- * This program is free software; you can redistribute it and/or modify
+ * This program is free software; you can redistribute it and/or modify
* it under the same terms as Perl itself.
*/
@@ -31,6 +31,7 @@
GV *gv;
HV *stash = CopSTASH(PL_curcop);
char *s, *end = NULL, saved;
+ MAGIC *mg;
PPCODE:
if (!SvROK(sub) && SvGMAGICAL(sub))
mg_get(sub);
@@ -41,7 +42,8 @@
else if (!SvOK(sub))
croak(PL_no_usym, "a subroutine");
else if (PL_op->op_private & HINT_STRICT_REFS)
- croak(PL_no_symref, SvPV_nolen(sub), "a subroutine");
+ croak("Can't use string (\"%.32s\") as %s ref while \"strict refs\" in use",
+ SvPV_nolen(sub), "a subroutine");
else if ((gv = gv_fetchpv(SvPV_nolen(sub), FALSE, SVt_PVCV)))
cv = GvCVu(gv);
if (!cv)
@@ -64,28 +66,26 @@
}
gv = (GV *) newSV(0);
gv_init(gv, stash, name, s - name, TRUE);
-#ifndef USE_5005THREADS
- if (CvPADLIST(cv)) {
- /* cheap way to refcount the gv */
- av_store((AV *) AvARRAY(CvPADLIST(cv))[0], 0, (SV *) gv);
- } else
+
+ mg = SvMAGIC(cv);
+ while (mg && mg->mg_virtual != &subname_vtbl)
+ mg = mg->mg_moremagic;
+ if (!mg) {
+ Newz(702, mg, 1, MAGIC);
+ mg->mg_moremagic = SvMAGIC(cv);
+ mg->mg_type = PERL_MAGIC_ext;
+ mg->mg_virtual = &subname_vtbl;
+ SvMAGIC_set(cv, mg);
+ }
+ if (mg->mg_flags & MGf_REFCOUNTED)
+ SvREFCNT_dec(mg->mg_obj);
+ mg->mg_flags |= MGf_REFCOUNTED;
+ mg->mg_obj = (SV *) gv;
+ SvRMAGICAL_on(cv);
+ CvANON_off(cv);
+#ifndef CvGV_set
+ CvGV(cv) = gv;
+#else
+ CvGV_set(cv, gv);
#endif
- {
- /* expensive way to refcount the gv */
- MAGIC *mg = SvMAGIC(cv);
- while (mg && mg->mg_virtual != &subname_vtbl)
- mg = mg->mg_moremagic;
- if (!mg) {
- Newz(702, mg, 1, MAGIC);
- mg->mg_moremagic = SvMAGIC(cv);
- mg->mg_type = PERL_MAGIC_ext;
- mg->mg_virtual = &subname_vtbl;
- SvMAGIC_set(cv, mg);
- }
- if (mg->mg_flags & MGf_REFCOUNTED)
- SvREFCNT_dec(mg->mg_obj);
- mg->mg_flags |= MGf_REFCOUNTED;
- mg->mg_obj = (SV *) gv;
- }
- CvGV(cv) = gv;
PUSHs(sub);
Modified: branches/upstream/libsub-name-perl/current/lib/Sub/Name.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsub-name-perl/current/lib/Sub/Name.pm?rev=62411&op=diff
==============================================================================
--- branches/upstream/libsub-name-perl/current/lib/Sub/Name.pm (original)
+++ branches/upstream/libsub-name-perl/current/lib/Sub/Name.pm Wed Sep 8 15:32:45 2010
@@ -44,7 +44,7 @@
use strict;
use warnings;
-our $VERSION = '0.04';
+our $VERSION = '0.05';
use base 'Exporter';
use base 'DynaLoader';
Added: branches/upstream/libsub-name-perl/current/t/RT42725_deparse.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libsub-name-perl/current/t/RT42725_deparse.t?rev=62411&op=file
==============================================================================
--- branches/upstream/libsub-name-perl/current/t/RT42725_deparse.t (added)
+++ branches/upstream/libsub-name-perl/current/t/RT42725_deparse.t Wed Sep 8 15:32:45 2010
@@ -1,0 +1,15 @@
+use strict;
+use warnings;
+use Test::More tests => 2;
+
+use Sub::Name;
+
+use B::Deparse;
+
+my $source = eval {
+ B::Deparse->new->coderef2text(subname foo => sub{ @_ });
+};
+
+ok !$@;
+
+like $source, qr/\@\_/;
More information about the Pkg-perl-cvs-commits
mailing list