Hello community,

here is the log from the commit of package perl-Params-Validate for 
openSUSE:Factory checked in at 2015-06-30 10:19:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Params-Validate (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Params-Validate.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Params-Validate"

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Params-Validate/perl-Params-Validate.changes    
    2015-06-15 17:50:38.000000000 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-Params-Validate.new/perl-Params-Validate.changes
   2015-06-30 10:19:10.000000000 +0200
@@ -1,0 +2,22 @@
+Mon Jun 29 01:27:01 UTC 2015 - [email protected]
+
+- updated to 1.20
+   see /usr/share/doc/packages/perl-Params-Validate/Changes
+
+  1.20    2015-06-28
+  
+  - Fixed a bug with stack handling in the XS code. If a callback sub caused
+    Perl to reallocate the stack this could trigger weird errors of the form
+    "Bizarre copy of ARRAY" from Perl itself. Fixed by Noel Maddy. GH #5.
+  
+  - Fixed use of inlining in the XS code to work when "gcc -std=c89" is
+    specified. Fixed by Vincent Pit. GH #6.
+  
+  - Previously, Params::Validate would eagerly stringify all values it was
+    validating, even though this stringification was only needed for error
+    messages that are used when a parameter fails. For objects which overload
+    stringification and do real work, this added an unnecessary
+    slowdown. Stringification is now delayed until it is needed. Reported by
+    Klaus. RT #105326.
+
+-------------------------------------------------------------------

Old:
----
  Params-Validate-1.19.tar.gz

New:
----
  Params-Validate-1.20.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Params-Validate.spec ++++++
--- /var/tmp/diff_new_pack.LDzxtv/_old  2015-06-30 10:19:11.000000000 +0200
+++ /var/tmp/diff_new_pack.LDzxtv/_new  2015-06-30 10:19:11.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Params-Validate
-Version:        1.19
+Version:        1.20
 Release:        0
 %define cpan_name Params-Validate
 Summary:        Validate method/function parameters

++++++ Params-Validate-1.19.tar.gz -> Params-Validate-1.20.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/Build.PL 
new/Params-Validate-1.20/Build.PL
--- old/Params-Validate-1.19/Build.PL   2015-06-13 05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/Build.PL   2015-06-28 16:34:36.000000000 +0200
@@ -20,7 +20,7 @@
     "Ilya Martynov <ilya\@martynov.org>"
   ],
   "dist_name" => "Params-Validate",
-  "dist_version" => "1.19",
+  "dist_version" => "1.20",
   "license" => "artistic_2",
   "module_name" => "Params::Validate",
   "recommends" => {},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/Changes 
new/Params-Validate-1.20/Changes
--- old/Params-Validate-1.19/Changes    2015-06-13 05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/Changes    2015-06-28 16:34:36.000000000 +0200
@@ -1,3 +1,20 @@
+1.20    2015-06-28
+
+- Fixed a bug with stack handling in the XS code. If a callback sub caused
+  Perl to reallocate the stack this could trigger weird errors of the form
+  "Bizarre copy of ARRAY" from Perl itself. Fixed by Noel Maddy. GH #5.
+
+- Fixed use of inlining in the XS code to work when "gcc -std=c89" is
+  specified. Fixed by Vincent Pit. GH #6.
+
+- Previously, Params::Validate would eagerly stringify all values it was
+  validating, even though this stringification was only needed for error
+  messages that are used when a parameter fails. For objects which overload
+  stringification and do real work, this added an unnecessary
+  slowdown. Stringification is now delayed until it is needed. Reported by
+  Klaus. RT #105326.
+
+
 1.19    2015-06-12
 
 - Fixed an uninitialized value warning from the pure Perl implementation under
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/MANIFEST 
new/Params-Validate-1.20/MANIFEST
--- old/Params-Validate-1.19/MANIFEST   2015-06-13 05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/MANIFEST   2015-06-28 16:34:36.000000000 +0200
@@ -120,5 +120,6 @@
 t/release-synopsis.t
 t/release-xs-is-loaded.t
 t/release-xs-segfault.t
+t/release-xs-stack-realloc.t
 tidyall.ini
 weaver.ini
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/META.json 
new/Params-Validate-1.20/META.json
--- old/Params-Validate-1.19/META.json  2015-06-13 05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/META.json  2015-06-28 16:34:36.000000000 +0200
@@ -85,23 +85,23 @@
    "provides" : {
       "Attribute::Params::Validate" : {
          "file" : "lib/Attribute/Params/Validate.pm",
-         "version" : "1.19"
+         "version" : "1.20"
       },
       "Params::Validate" : {
          "file" : "lib/Params/Validate.pm",
-         "version" : "1.19"
+         "version" : "1.20"
       },
       "Params::Validate::Constants" : {
          "file" : "lib/Params/Validate/Constants.pm",
-         "version" : "1.19"
+         "version" : "1.20"
       },
       "Params::Validate::PP" : {
          "file" : "lib/Params/Validate/PP.pm",
-         "version" : "1.19"
+         "version" : "1.20"
       },
       "Params::Validate::XS" : {
          "file" : "lib/Params/Validate/XS.pm",
-         "version" : "1.19"
+         "version" : "1.20"
       }
    },
    "release_status" : "stable",
@@ -117,7 +117,7 @@
          "web" : "https://github.com/autarch/Params-Validate";
       }
    },
-   "version" : "1.19",
+   "version" : "1.20",
    "x_Dist_Zilla" : {
       "perl" : {
          "version" : "5.020001"
@@ -136,7 +136,7 @@
          {
             "class" : "Dist::Zilla::Plugin::CopyFilesFromBuild",
             "name" : "@DROLSKY/CopyFilesFromBuild",
-            "version" : "0.150250"
+            "version" : "0.151680"
          },
          {
             "class" : "Dist::Zilla::Plugin::Git::GatherDir",
@@ -144,10 +144,10 @@
                "Dist::Zilla::Plugin::GatherDir" : {
                   "exclude_filename" : [
                      "README.md",
-                     "Makefile.PL",
-                     "Build.PL",
+                     "cpanfile",
                      "LICENSE",
-                     "cpanfile"
+                     "Makefile.PL",
+                     "Build.PL"
                   ],
                   "exclude_match" : [],
                   "follow_symlinks" : "0",
@@ -242,7 +242,7 @@
                }
             },
             "name" : "@DROLSKY/PromptIfStale",
-            "version" : "0.044"
+            "version" : "0.045"
          },
          {
             "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
@@ -574,10 +574,10 @@
                "Dist::Zilla::Role::Git::DirtyFiles" : {
                   "allow_dirty" : [
                      "README.md",
+                     "cpanfile",
+                     "LICENSE",
                      "Makefile.PL",
                      "Build.PL",
-                     "LICENSE",
-                     "cpanfile",
                      "Changes",
                      "CONTRIBUTING.md"
                   ],
@@ -602,10 +602,10 @@
                "Dist::Zilla::Role::Git::DirtyFiles" : {
                   "allow_dirty" : [
                      "README.md",
+                     "cpanfile",
+                     "LICENSE",
                      "Makefile.PL",
                      "Build.PL",
-                     "LICENSE",
-                     "cpanfile",
                      "Changes",
                      "CONTRIBUTING.md"
                   ],
@@ -625,7 +625,7 @@
                "Dist::Zilla::Plugin::Git::Tag" : {
                   "branch" : null,
                   "signed" : 0,
-                  "tag" : "v1.19",
+                  "tag" : "v1.20",
                   "tag_format" : "v%v",
                   "tag_message" : "v%v",
                   "time_zone" : "local"
@@ -781,8 +781,11 @@
    },
    "x_authority" : "cpan:DROLSKY",
    "x_contributors" : [
+      "Ivan Bessarabov <[email protected]>",
       "J.R. Mash <[email protected]>",
-      "Olivier Mengué <[email protected]>"
+      "Noel Maddy <[email protected]>",
+      "Olivier Mengué <[email protected]>",
+      "Vincent Pit <[email protected]>"
    ]
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/META.yml 
new/Params-Validate-1.20/META.yml
--- old/Params-Validate-1.19/META.yml   2015-06-13 05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/META.yml   2015-06-28 16:34:36.000000000 +0200
@@ -29,19 +29,19 @@
 provides:
   Attribute::Params::Validate:
     file: lib/Attribute/Params/Validate.pm
-    version: '1.19'
+    version: '1.20'
   Params::Validate:
     file: lib/Params/Validate.pm
-    version: '1.19'
+    version: '1.20'
   Params::Validate::Constants:
     file: lib/Params/Validate/Constants.pm
-    version: '1.19'
+    version: '1.20'
   Params::Validate::PP:
     file: lib/Params/Validate/PP.pm
-    version: '1.19'
+    version: '1.20'
   Params::Validate::XS:
     file: lib/Params/Validate/XS.pm
-    version: '1.19'
+    version: '1.20'
 requires:
   Attribute::Handlers: '0.79'
   Carp: '0'
@@ -58,7 +58,7 @@
   bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=Params-Validate
   homepage: http://metacpan.org/release/Params-Validate
   repository: git://github.com/autarch/Params-Validate.git
-version: '1.19'
+version: '1.20'
 x_Dist_Zilla:
   perl:
     version: '5.020001'
@@ -74,17 +74,17 @@
     -
       class: Dist::Zilla::Plugin::CopyFilesFromBuild
       name: '@DROLSKY/CopyFilesFromBuild'
-      version: '0.150250'
+      version: '0.151680'
     -
       class: Dist::Zilla::Plugin::Git::GatherDir
       config:
         Dist::Zilla::Plugin::GatherDir:
           exclude_filename:
             - README.md
+            - cpanfile
+            - LICENSE
             - Makefile.PL
             - Build.PL
-            - LICENSE
-            - cpanfile
           exclude_match: []
           follow_symlinks: '0'
           include_dotfiles: '0'
@@ -155,7 +155,7 @@
             - Dist::Zilla::Plugin::DROLSKY::License
             - Dist::Zilla::Plugin::DROLSKY::TidyAll
       name: '@DROLSKY/PromptIfStale'
-      version: '0.044'
+      version: '0.045'
     -
       class: Dist::Zilla::Plugin::ReadmeAnyFromPod
       name: '@DROLSKY/README.md in build'
@@ -414,10 +414,10 @@
         Dist::Zilla::Role::Git::DirtyFiles:
           allow_dirty:
             - README.md
+            - cpanfile
+            - LICENSE
             - Makefile.PL
             - Build.PL
-            - LICENSE
-            - cpanfile
             - Changes
             - CONTRIBUTING.md
           allow_dirty_match: []
@@ -436,10 +436,10 @@
         Dist::Zilla::Role::Git::DirtyFiles:
           allow_dirty:
             - README.md
+            - cpanfile
+            - LICENSE
             - Makefile.PL
             - Build.PL
-            - LICENSE
-            - cpanfile
             - Changes
             - CONTRIBUTING.md
           allow_dirty_match: []
@@ -454,7 +454,7 @@
         Dist::Zilla::Plugin::Git::Tag:
           branch: ~
           signed: 0
-          tag: v1.19
+          tag: v1.20
           tag_format: v%v
           tag_message: v%v
           time_zone: local
@@ -568,5 +568,8 @@
     version: '5.037'
 x_authority: cpan:DROLSKY
 x_contributors:
+  - 'Ivan Bessarabov <[email protected]>'
   - 'J.R. Mash <[email protected]>'
+  - 'Noel Maddy <[email protected]>'
   - 'Olivier Mengué <[email protected]>'
+  - 'Vincent Pit <[email protected]>'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/README.md 
new/Params-Validate-1.20/README.md
--- old/Params-Validate-1.19/README.md  2015-06-13 05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/README.md  2015-06-28 16:34:36.000000000 +0200
@@ -4,7 +4,7 @@
 
 VERSION
 
-    version 1.19
+    version 1.20
 
 SYNOPSIS
 
@@ -430,8 +430,8 @@
                     optional => 1,
                     depends  => [ 'cc_expiration', 'cc_holder_name' ],
                 },
-                cc_expiration  { type => SCALAR, optional => 1 },
-                cc_holder_name { type => SCALAR, optional => 1 },
+                cc_expiration  => { type => SCALAR, optional => 1 },
+                cc_holder_name => { type => SCALAR, optional => 1 },
             }
         );
 
@@ -768,10 +768,16 @@
 
 CONTRIBUTORS
 
+      * Ivan Bessarabov <[email protected]>
+
       * J.R. Mash <[email protected]>
 
+      * Noel Maddy <[email protected]>
+
       * Olivier Mengué <[email protected]>
 
+      * Vincent Pit <[email protected]>
+
 COPYRIGHT AND LICENSE
 
     This software is Copyright (c) 2001 - 2015 by Dave Rolsky and Ilya
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Params-Validate-1.19/lib/Attribute/Params/Validate.pm 
new/Params-Validate-1.20/lib/Attribute/Params/Validate.pm
--- old/Params-Validate-1.19/lib/Attribute/Params/Validate.pm   2015-06-13 
05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/lib/Attribute/Params/Validate.pm   2015-06-28 
16:34:36.000000000 +0200
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.19';
+our $VERSION = '1.20';
 
 use attributes;
 
@@ -100,7 +100,7 @@
 
 =head1 VERSION
 
-version 1.19
+version 1.20
 
 =head1 SYNOPSIS
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Params-Validate-1.19/lib/Params/Validate/Constants.pm 
new/Params-Validate-1.20/lib/Params/Validate/Constants.pm
--- old/Params-Validate-1.19/lib/Params/Validate/Constants.pm   2015-06-13 
05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/lib/Params/Validate/Constants.pm   2015-06-28 
16:34:36.000000000 +0200
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.19';
+our $VERSION = '1.20';
 
 our @ISA = 'Exporter';
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/lib/Params/Validate/PP.pm 
new/Params-Validate-1.20/lib/Params/Validate/PP.pm
--- old/Params-Validate-1.19/lib/Params/Validate/PP.pm  2015-06-13 
05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/lib/Params/Validate/PP.pm  2015-06-28 
16:34:36.000000000 +0200
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.19';
+our $VERSION = '1.20';
 
 use Params::Validate::Constants;
 use Scalar::Util 1.10 ();
@@ -99,10 +99,9 @@
         next unless ref $spec;
 
         if ( $_ <= $#p ) {
-            my $value = defined $p[$_] ? qq|"$p[$_]"| : 'undef';
             _validate_one_param(
                 $p[$_], \@p, $spec,
-                "Parameter #" . ( $_ + 1 ) . " ($value)"
+                'Parameter #' . ( $_ + 1 ) . ' (%s)'
             );
         }
 
@@ -340,7 +339,7 @@
             my $value = defined $p->{$key} ? qq|"$p->{$key}"| : 'undef';
             _validate_one_param(
                 $p->{$key}, $p, $spec,
-                "The '$key' parameter ($value)"
+                qq{The '$key' parameter (%s)}
             );
         }
     }
@@ -469,7 +468,7 @@
             $msg
                 .= ".\n Use the constants exported by Params::Validate to 
declare types.";
 
-            $options->{on_fail}->($msg);
+            $options->{on_fail}->( sprintf( $msg, _stringify($value) ) );
         }
 
         unless ( _get_type($value) & $spec->{type} ) {
@@ -481,8 +480,13 @@
 
             my $called = _get_called(1);
 
-            $options->{on_fail}->( "$id to $called was $article '@is', which "
-                    . "is not one of the allowed types: @allowed\n" );
+            $options->{on_fail}->(
+                sprintf(
+                    "$id to $called was $article '@is', which "
+                        . "is not one of the allowed types: @allowed\n",
+                    _stringify($value)
+                )
+            );
         }
     }
 
@@ -507,9 +511,12 @@
 
                 my $called = _get_called(1);
 
-                $options->{on_fail}
-                    ->(   "$id to $called was not $article1 '$_' "
-                        . "(it is $article2 $is)\n" );
+                $options->{on_fail}->(
+                    sprintf(
+                              "$id to $called was not $article1 '$_' "
+                            . "(it is $article2 $is)\n", _stringify($value)
+                    )
+                );
             }
         }
     }
@@ -524,8 +531,12 @@
                 ) {
                 my $called = _get_called(1);
 
-                $options->{on_fail}
-                    ->("$id to $called does not have the method: '$_'\n");
+                $options->{on_fail}->(
+                    sprintf(
+                        "$id to $called does not have the method: '$_'\n",
+                        _stringify($value)
+                    )
+                );
             }
         }
     }
@@ -559,16 +570,15 @@
             if ( !$ok ) {
                 my $called = _get_called(1);
 
-                my $msg;
                 if ( ref $e ) {
-                    $msg = $e;
+                    $options->{on_fail}->($e);
                 }
                 else {
-                    $msg = "$id to $called did not pass the '$_' callback";
+                    my $msg = "$id to $called did not pass the '$_' callback";
                     $msg .= ": $e" if length $e;
                     $msg .= "\n";
+                    $options->{on_fail}->( sprintf( $msg, _stringify($value) ) 
);
                 }
-                $options->{on_fail}->($msg);
             }
         }
     }
@@ -577,8 +587,12 @@
         unless ( ( defined $value ? $value : '' ) =~ /$spec->{regex}/ ) {
             my $called = _get_called(1);
 
-            $options->{on_fail}
-                ->("$id to $called did not pass regex check\n");
+            $options->{on_fail}->(
+                sprintf(
+                    "$id to $called did not pass regex check\n",
+                    _stringify($value)
+                )
+            );
         }
     }
 }
@@ -714,4 +728,8 @@
     return $called;
 }
 
+sub _stringify {
+    return defined $_[0] ? qq{"$_[0]"} : 'undef';
+}
+
 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/lib/Params/Validate/XS.pm 
new/Params-Validate-1.20/lib/Params/Validate/XS.pm
--- old/Params-Validate-1.19/lib/Params/Validate/XS.pm  2015-06-13 
05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/lib/Params/Validate/XS.pm  2015-06-28 
16:34:36.000000000 +0200
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.19';
+our $VERSION = '1.20';
 
 use Carp;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/lib/Params/Validate/XS.xs 
new/Params-Validate-1.20/lib/Params/Validate/XS.xs
--- old/Params-Validate-1.19/lib/Params/Validate/XS.xs  2015-06-13 
05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/lib/Params/Validate/XS.xs  2015-06-28 
16:34:36.000000000 +0200
@@ -5,7 +5,7 @@
 #include "XSUB.h"
 #include "ppport.h"
 
-#ifdef __GNUC__
+#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L))
 #define INLINE inline
 #else
 #define INLINE
@@ -246,6 +246,16 @@
     return "a";
 }
 
+char *
+string_representation(SV* value) {
+    if(SvOK(value)) {
+        return (void *)form("\"%s\"", SvPV_nolen(value));
+    }
+    else {
+        return (void *)"undef";
+    }
+}
+
 /* raises exception either using user-defined callback or using
    built-in method */
 static void
@@ -364,7 +374,7 @@
 
 /* $value->isa alike validation */
 static IV
-validate_isa(SV* value, SV* package, SV* id, HV* options) {
+validate_isa(SV* value, SV* package, char* id, HV* options) {
     IV ok = 1;
 
     if (! value) {
@@ -409,7 +419,7 @@
 
     if (! ok) {
         SV *caller = get_caller(options);
-        SV* buffer = newSVsv(id);
+        SV* buffer = newSVpvf(id, string_representation(value));
         sv_catpv(buffer, " to ");
         sv_catsv(buffer, caller);
         SvREFCNT_dec(caller);
@@ -434,7 +444,7 @@
 }
 
 static IV
-validate_can(SV* value, SV* method, SV* id, HV* options) {
+validate_can(SV* value, SV* method, char* id, HV* options) {
     IV ok = 1;
 
     if (! value) {
@@ -478,7 +488,7 @@
     }
 
     if (! ok) {
-        SV* buffer = newSVsv(id);
+        SV* buffer = newSVpvf(id, string_representation(value));
         SV *caller = get_caller(options);
         sv_catpv(buffer, " to ");
         sv_catsv(buffer, caller);
@@ -494,7 +504,7 @@
 
 /* validates specific parameter using supplied parameter specification */
 static IV
-validate_one_param(SV* value, SV* params, HV* spec, SV* id, HV* options, IV* 
untaint) {
+validate_one_param(SV* value, SV* params, HV* spec, char* id, HV* options, IV* 
untaint) {
     SV** temp;
     IV   i;
 
@@ -531,7 +541,7 @@
             && looks_like_number(*temp)
             && SvIV(*temp) > 0 ) ) {
 
-            SV* buffer = newSVsv(id);
+            SV* buffer = newSVpvf(id, string_representation(value));
             sv_catpv( buffer, " has a type specification which is not a 
number. It is ");
             if ( SvOK(*temp) ) {
                 sv_catpv( buffer, "a string - " );
@@ -548,7 +558,7 @@
         SvGETMAGIC(*temp);
         type = get_type(value);
         if (! (type & SvIV(*temp))) {
-            SV* buffer = newSVsv(id);
+            SV* buffer = newSVpvf(id, string_representation(value));
             SV *caller = get_caller(options);
             SV* is;
             SV* allowed;
@@ -699,7 +709,7 @@
                         validation_failure(err, options);
                     }
                     else {
-                        SV* buffer = newSVsv(id);
+                        SV* buffer = newSVpvf(id, 
string_representation(value));
                         SV *caller = get_caller(options);
 
                         sv_catpv(buffer, " to ");
@@ -770,7 +780,7 @@
         PUTBACK;
 
         if (!ok) {
-            SV* buffer = newSVsv(id);
+            SV* buffer = newSVpvf(id, string_representation(value));
             SV *caller = get_caller(options);
 
             sv_catpv(buffer, " to ");
@@ -1098,18 +1108,6 @@
 }
 
 void
-cat_string_representation(SV* buffer, SV* value) {
-    if(SvOK(value)) {
-        sv_catpv(buffer, "\"");
-        sv_catpv(buffer, SvPV_nolen(value));
-        sv_catpv(buffer, "\"");
-    }
-    else {
-        sv_catpv(buffer, "undef");
-    }
-}
-
-void
 apply_defaults(HV *ret, HV *p, HV *specs, AV *missing) {
     HE* he;
     SV** temp;
@@ -1266,16 +1264,12 @@
         if(he1) {
             hv1 = HeVAL(he1);
             if (SvROK(hv1) && SvTYPE(SvRV(hv1)) == SVt_PVHV) {
-                SV* buffer;
+                char* buffer;
                 HV* spec;
                 IV untaint = 0;
 
                 spec = (HV*) SvRV(hv1);
-                buffer = sv_2mortal(newSVpv("The '", 0));
-                sv_catsv(buffer, HeSVKEY_force(he));
-                sv_catpv(buffer, "' parameter (");
-                cat_string_representation(buffer, hv);
-                sv_catpv(buffer, ")");
+                buffer = form("The '%s' parameter (%%s)", HePV(he, PL_na));
 
                 if (! validate_one_param(hv, (SV*) p, spec, buffer, options, 
&untaint))
                     return 0;
@@ -1292,7 +1286,7 @@
         }
 
         if (av_len(unmentioned) > -1) {
-            SV* buffer =  newSVpv("The following parameter", 0);
+            SV* buffer = newSVpv("The following parameter", 0);
             SV *caller = get_caller(options);
 
             if (av_len(unmentioned) != 0) {
@@ -1437,7 +1431,7 @@
 
 static IV
 validate_pos(AV* p, AV* specs, HV* options, AV* ret) {
-    SV* buffer;
+    char* buffer;
     SV* value;
     SV* spec = NULL;
     SV** temp;
@@ -1503,12 +1497,9 @@
             if (complex_spec) {
                 IV untaint = 0;
 
-                buffer = sv_2mortal(newSVpvf("Parameter #%d (", (int) i + 1));
-                cat_string_representation(buffer, value);
-                sv_catpv(buffer, ")");
+                buffer = form("Parameter #%d (%%s)", (int)i + 1);
 
-                if (! validate_one_param(value, (SV*) p, (HV*) SvRV(spec),
-                buffer, options, &untaint)) {
+                if (! validate_one_param(value, (SV*) p, (HV*) SvRV(spec), 
buffer, options, &untaint)) {
                     return 0;
                 }
 
@@ -1748,11 +1739,14 @@
                 ret = (AV*) sv_2mortal((SV*) newAV());
             }
 
-            if (! validate_pos((AV*) SvRV(params), (AV*) SvRV(spec),
-            get_options(p), ret)) {
+            PUTBACK;
+
+            if (! validate_pos((AV*) SvRV(params), (AV*) SvRV(spec), 
get_options(p), ret)) {
+                SPAGAIN;
                 XSRETURN(0);
             }
 
+            SPAGAIN;
             RETURN_ARRAY(ret);
         }
         else {
@@ -1802,10 +1796,14 @@
             ret = (HV*) sv_2mortal((SV*) newHV());
         }
 
+        PUTBACK;
+
         if (! validate(hv, (HV*) SvRV(spec), options, ret)) {
+            SPAGAIN;
             XSRETURN(0);
         }
 
+        SPAGAIN;
         RETURN_HASH(ret);
     }
     else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/lib/Params/Validate.pm 
new/Params-Validate-1.20/lib/Params/Validate.pm
--- old/Params-Validate-1.19/lib/Params/Validate.pm     2015-06-13 
05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/lib/Params/Validate.pm     2015-06-28 
16:34:36.000000000 +0200
@@ -5,7 +5,7 @@
 use strict;
 use warnings;
 
-our $VERSION = '1.19';
+our $VERSION = '1.20';
 
 use Exporter;
 use Module::Implementation;
@@ -75,7 +75,7 @@
 
 =head1 VERSION
 
-version 1.19
+version 1.20
 
 =head1 SYNOPSIS
 
@@ -510,8 +510,8 @@
                 optional => 1,
                 depends  => [ 'cc_expiration', 'cc_holder_name' ],
             },
-            cc_expiration  { type => SCALAR, optional => 1 },
-            cc_holder_name { type => SCALAR, optional => 1 },
+            cc_expiration  => { type => SCALAR, optional => 1 },
+            cc_holder_name => { type => SCALAR, optional => 1 },
         }
     );
 
@@ -863,18 +863,30 @@
 
 =head1 CONTRIBUTORS
 
-=for stopwords J.R. Mash Olivier Mengué
+=for stopwords Ivan Bessarabov J.R. Mash Noel Maddy Olivier Mengué Vincent Pit
 
 =over 4
 
 =item *
 
+Ivan Bessarabov <[email protected]>
+
+=item *
+
 J.R. Mash <[email protected]>
 
 =item *
 
+Noel Maddy <[email protected]>
+
+=item *
+
 Olivier Mengué <[email protected]>
 
+=item *
+
+Vincent Pit <[email protected]>
+
 =back
 
 =head1 COPYRIGHT AND LICENSE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/lib/Params/ValidatePP.pm 
new/Params-Validate-1.20/lib/Params/ValidatePP.pm
--- old/Params-Validate-1.19/lib/Params/ValidatePP.pm   2015-06-13 
05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/lib/Params/ValidatePP.pm   2015-06-28 
16:34:36.000000000 +0200
@@ -1,7 +1,7 @@
 package    # hide from PAUSE
     Params::Validate;
 
-our $VERSION = '1.19';
+our $VERSION = '1.20';
 
 BEGIN { $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'PP' }
 use Params::Validate;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/lib/Params/ValidateXS.pm 
new/Params-Validate-1.20/lib/Params/ValidateXS.pm
--- old/Params-Validate-1.19/lib/Params/ValidateXS.pm   2015-06-13 
05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/lib/Params/ValidateXS.pm   2015-06-28 
16:34:36.000000000 +0200
@@ -1,7 +1,7 @@
 package # hide from PAUSE
     Params::Validate;
 
-our $VERSION = '1.19';
+our $VERSION = '1.20';
 
 BEGIN { $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'XS' }
 use Params::Validate;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/t/author-eol.t 
new/Params-Validate-1.20/t/author-eol.t
--- old/Params-Validate-1.19/t/author-eol.t     2015-06-13 05:49:43.000000000 
+0200
+++ new/Params-Validate-1.20/t/author-eol.t     2015-06-28 16:34:36.000000000 
+0200
@@ -118,7 +118,8 @@
     't/release-pp-is-loaded.t',
     't/release-synopsis.t',
     't/release-xs-is-loaded.t',
-    't/release-xs-segfault.t'
+    't/release-xs-segfault.t',
+    't/release-xs-stack-realloc.t'
 );
 
 eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/t/author-no-tabs.t 
new/Params-Validate-1.20/t/author-no-tabs.t
--- old/Params-Validate-1.19/t/author-no-tabs.t 2015-06-13 05:49:43.000000000 
+0200
+++ new/Params-Validate-1.20/t/author-no-tabs.t 2015-06-28 16:34:36.000000000 
+0200
@@ -118,7 +118,8 @@
     't/release-pp-is-loaded.t',
     't/release-synopsis.t',
     't/release-xs-is-loaded.t',
-    't/release-xs-segfault.t'
+    't/release-xs-segfault.t',
+    't/release-xs-stack-realloc.t'
 );
 
 notabs_ok($_) foreach @files;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/t/author-pod-spell.t 
new/Params-Validate-1.20/t/author-pod-spell.t
--- old/Params-Validate-1.19/t/author-pod-spell.t       2015-06-13 
05:49:43.000000000 +0200
+++ new/Params-Validate-1.20/t/author-pod-spell.t       2015-06-28 
16:34:36.000000000 +0200
@@ -39,11 +39,20 @@
 Martynov
 ilya
 and
+Ivan
+Bessarabov
+ivan
 Mash
 jmash
+Noel
+Maddy
+zhtwnpanta
 Olivier
 Mengué
 dolmen
+Vincent
+Pit
+perl
 lib
 Attribute
 Params
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Params-Validate-1.19/t/release-xs-stack-realloc.t 
new/Params-Validate-1.20/t/release-xs-stack-realloc.t
--- old/Params-Validate-1.19/t/release-xs-stack-realloc.t       1970-01-01 
01:00:00.000000000 +0100
+++ new/Params-Validate-1.20/t/release-xs-stack-realloc.t       2015-06-28 
16:34:36.000000000 +0200
@@ -0,0 +1,60 @@
+
+BEGIN {
+  unless ($ENV{RELEASE_TESTING}) {
+    require Test::More;
+    Test::More::plan(skip_all => 'these tests are for release candidate 
testing');
+  }
+}
+
+use strict;
+use warnings;
+
+use Test::More;
+
+BEGIN {
+    $ENV{PARAMS_VALIDATE_IMPLEMENTATION} = 'XS';
+    $ENV{PV_WARN_FAILED_IMPLEMENTATION}  = 1;
+}
+
+use Params::Validate qw( validate_with );
+
+my $alloc_size;
+for my $i ( 0 .. 15 ) {
+    $alloc_size = 2**$i;
+    test_array_spec(undef);
+}
+
+ok( 1, 'array validation succeeded with stack realloc' );
+
+for my $i ( 0 .. 15 ) {
+    $alloc_size = 2**$i;
+    test_hash_spec( a => undef );
+}
+
+ok( 1, 'hash validation succeeded with stack realloc' );
+
+done_testing();
+
+sub grow_stack {
+    my @stuff = (1) x $alloc_size;
+
+    # "validation" always succeeds - we just need the stack to grow inside a
+    # callback to trigger the bug.
+    return 1;
+}
+
+sub test_array_spec {
+    my @args = validate_with(
+        params => \@_,
+        spec   => [ { callbacks => { grow_stack => \&grow_stack } } ],
+    );
+}
+
+sub test_hash_spec {
+    my %args = validate_with(
+        params => \@_,
+        spec   => {
+            a => { callbacks => { grow_stack => \&grow_stack } },
+        },
+    );
+}


Reply via email to