r60335 - in /branches/upstream/libpadwalker-perl/current: Changes Makefile.PL PadWalker.pm PadWalker.xs README t/closure.t

carnil-guest at users.alioth.debian.org carnil-guest at users.alioth.debian.org
Thu Jul 15 21:14:20 UTC 2010


Author: carnil-guest
Date: Thu Jul 15 21:14:02 2010
New Revision: 60335

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60335
Log:
[svn-upgrade] new version libpadwalker-perl (1.92)

Modified:
    branches/upstream/libpadwalker-perl/current/Changes
    branches/upstream/libpadwalker-perl/current/Makefile.PL
    branches/upstream/libpadwalker-perl/current/PadWalker.pm
    branches/upstream/libpadwalker-perl/current/PadWalker.xs
    branches/upstream/libpadwalker-perl/current/README
    branches/upstream/libpadwalker-perl/current/t/closure.t

Modified: branches/upstream/libpadwalker-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/Changes?rev=60335&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/Changes (original)
+++ branches/upstream/libpadwalker-perl/current/Changes Thu Jul 15 21:14:02 2010
@@ -126,3 +126,12 @@
 1.9  Fri 26 Jun 2009 10:01:17 BST
 	- Identical to 1.8, but with the bogus metadata ._ files removed
 	  from the distributed tar file.
+
+1.91  Wed 14 Jul 2010 01:07:05 BST
+	- Incorporate patches from Florian Ragwitz and Yuval Kogman
+          (see http://github.com/robinhouston/PadWalker/commits/master)
+
+1.92  Thu 15 Jul 2010 17:05:05 BST
+	- Remove "Jobsian dot file cruft" reported by Steve Mynott.
+	- Incorporate patch from Fuji, Goro, correcting earlier patch from Yuval Kogman.
+

Modified: branches/upstream/libpadwalker-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/Makefile.PL?rev=60335&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/Makefile.PL (original)
+++ branches/upstream/libpadwalker-perl/current/Makefile.PL Thu Jul 15 21:14:02 2010
@@ -34,5 +34,5 @@
     'INC'	=> '',     # e.g., '-I/usr/include/other',
     ($DEBUGGING ? (CCFLAGS => '-Wall -ansi') : ()),
     'NO_META'   => 1,
-    dist => {TAR => 'gnutar'}
+    dist => {TAR => 'env COPYFILE_DISABLE=true tar'}
 );

Modified: branches/upstream/libpadwalker-perl/current/PadWalker.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/PadWalker.pm?rev=60335&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/PadWalker.pm (original)
+++ branches/upstream/libpadwalker-perl/current/PadWalker.pm Thu Jul 15 21:14:02 2010
@@ -12,7 +12,7 @@
 @EXPORT_OK = qw(peek_my peek_our closed_over peek_sub var_name set_closed_over);
 %EXPORT_TAGS = (all => \@EXPORT_OK);
 
-$VERSION = '1.9';
+$VERSION = '1.92';
 
 bootstrap PadWalker $VERSION;
 

Modified: branches/upstream/libpadwalker-perl/current/PadWalker.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/PadWalker.xs?rev=60335&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/PadWalker.xs (original)
+++ branches/upstream/libpadwalker-perl/current/PadWalker.xs Thu Jul 15 21:14:02 2010
@@ -1,6 +1,10 @@
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
+
+#ifndef isGV_with_GP
+#define isGV_with_GP(x) isGV(x)
+#endif
 
 #ifndef CxOLD_OP_TYPE
 #  define CxOLD_OP_TYPE(cx)      (0 + (cx)->blk_eval.old_op_type)
@@ -244,7 +248,7 @@
               }
 
               hv_store((is_our ? our_hash : my_hash), name_str, name_len,
-                       newRV_inc(val_sv), 0);
+                       (val_sv ? newRV_inc(val_sv) : &PL_sv_undef), 0);
             }
           }
         }
@@ -456,6 +460,26 @@
     }
 }
 
+STATIC bool
+is_scalar_type(SV *sv) {
+    return !(
+        SvTYPE(sv) == SVt_PVAV
+     || SvTYPE(sv) == SVt_PVHV
+     || SvTYPE(sv) == SVt_PVCV
+     || isGV_with_GP(sv)
+     || SvTYPE(sv) == SVt_PVIO
+   );
+}
+
+STATIC bool
+is_correct_type(SV *orig, SV *restore) {
+    return (
+        ( SvTYPE(orig) == SvTYPE(restore) )
+            ||
+        ( is_scalar_type(orig) && is_scalar_type(restore) )
+    );
+}
+
 
 MODULE = PadWalker              PACKAGE = PadWalker
 PROTOTYPES: DISABLE             
@@ -496,8 +520,6 @@
     SvREFCNT_dec((SV*) ignore);
     EXTEND(SP, 1);
     PUSHs(sv_2mortal(newRV_noinc((SV*)ret)));
-
-
 
 void
 set_closed_over(sv, pad)
@@ -524,8 +546,9 @@
             if ( SvROK(*restore_ref) ) {
               SV *restore = SvRV(*restore_ref);
               SV **orig = av_fetch(pad_vallist, i, 0);
-
-              if ( !orig || !*orig || strcmp(sv_reftype(*orig, 0), sv_reftype(restore, 0)) == 0 ) {
+              int restore_type = SvTYPE(restore);
+
+              if ( !orig || !*orig || is_correct_type(*orig, restore) ) {
                 SvREFCNT_inc(restore);
 
                 if ( av_store(pad_vallist, i, restore) == NULL )

Modified: branches/upstream/libpadwalker-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/README?rev=60335&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/README (original)
+++ branches/upstream/libpadwalker-perl/current/README Thu Jul 15 21:14:02 2010
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
-| PadWalker v1.8    - Robin Houston
+| PadWalker v1.92    - Robin Houston
 -----------------------------------------------------------------------------
 
 NAME
@@ -106,13 +106,14 @@
 AUTHOR
        Robin Houston <robin at cpan.org>
 
-       With contributions from Richard Soberberg, bug-spotting from Peter
-       Scott and Dave Mitchell, and suggestions from demerphq.
+       With contributions from Richard Soberberg, Florian Ragwitz, Yuval Kogman, and
+       Fuji, Goro, bug-spotting from Peter Scott and Dave Mitchell, and suggestions
+       from demerphq.
 
 SEE ALSO
        Devel::LexAlias, Devel::Caller, Sub::Parameters
 
 COPYRIGHT
-       Copyright (c) 2000-2009, Robin Houston. All Rights Reserved.  This mod-
+       Copyright (c) 2000-2010, Robin Houston. All Rights Reserved.  This mod-
        ule is free software. It may be used, redistributed and/or modified
        under the same terms as Perl itself.

Modified: branches/upstream/libpadwalker-perl/current/t/closure.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpadwalker-perl/current/t/closure.t?rev=60335&op=diff
==============================================================================
--- branches/upstream/libpadwalker-perl/current/t/closure.t (original)
+++ branches/upstream/libpadwalker-perl/current/t/closure.t Thu Jul 15 21:14:02 2010
@@ -1,7 +1,7 @@
 use strict; use warnings;
 use PadWalker 'closed_over', 'set_closed_over';
 
-print "1..28\n";
+print "1..29\n";
 
 my $x=2;
 my $h = closed_over (my $sub = sub {my $y = $x++});
@@ -64,6 +64,7 @@
     my $x     = 1;
     my @foo   = ();
     my $other = 5;
+    my $ref   = \"foo";
     my $h     = closed_over( my $sub = sub { my $y = $x++; push @foo, $y; $y } );
 
     my @keys = keys %$h;
@@ -97,4 +98,9 @@
     eval { set_closed_over( $sub, { '@foo' => \"foo" } ) };
 
     print( $@ ? "ok 28\n" : "not ok 28\n" );
+
+    # test that REF and SCALAR are interchangiable
+    eval { set_closed_over( $sub, { '$x' => \$ref } ) };
+
+    print( $@ ? "not ok 29\n" : "ok 29\n" );
 }




More information about the Pkg-perl-cvs-commits mailing list