Compare commits
No commits in common. 'c9' and 'c10-beta' have entirely different histories.
@ -1 +1 @@
|
||||
SOURCES/Data-Dumper-2.173.tar.gz
|
||||
SOURCES/Data-Dumper-2.183.tar.gz
|
||||
|
@ -1 +1 @@
|
||||
91ca53fd5499b913996009e763d73ebeb51be8c3 SOURCES/Data-Dumper-2.173.tar.gz
|
||||
487944cc1200db9b698569c2b122bc7be4e1bceb SOURCES/Data-Dumper-2.183.tar.gz
|
||||
|
@ -1,243 +0,0 @@
|
||||
From 900c00b2ae29aa10b5cf0b3b5c55aff7501fc382 Mon Sep 17 00:00:00 2001
|
||||
From: Tony Cook <tony@develop-help.com>
|
||||
Date: Wed, 12 Aug 2020 16:20:16 +1000
|
||||
Subject: [PATCH 3/3] Data::Dumper (XS): use mortals to prevent leaks if magic
|
||||
throws
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
For example:
|
||||
|
||||
use Tie::Scalar;
|
||||
use Data::Dumper;
|
||||
sub T::TIESCALAR { bless {}, shift}
|
||||
sub T::FETCH { die }
|
||||
my $x;
|
||||
tie $x, "T" or die;
|
||||
while(1) {
|
||||
eval { () = Dumper( [ \$x ] ) };
|
||||
}
|
||||
|
||||
would leak various work SVs.
|
||||
|
||||
I start a new scope (ENTER/LEAVE) for most recursive DD_dump() calls
|
||||
so that the work SVs don't accumulate on the temps stack, for example
|
||||
if we're dumping a large array we'd end up with several SVs on the
|
||||
temp stack for each member of the array.
|
||||
|
||||
The exceptions are where I don't expect a large number of unreleased
|
||||
temps to accumulate, as with scalar or glob refs.
|
||||
|
||||
Petr Písař: Ported to Data-Dumper-2.173 from
|
||||
815b4be4ab7ae210f796fc9d29754e55fc0d1f0e perl commit.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
Dumper.xs | 52 ++++++++++++++++++++++++++++------------------------
|
||||
1 file changed, 28 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/Dumper.xs b/Dumper.xs
|
||||
index d4b34ad..65639ae 100644
|
||||
--- a/Dumper.xs
|
||||
+++ b/Dumper.xs
|
||||
@@ -808,12 +808,13 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
sv_catpvs(retval, "( ");
|
||||
if (style->indent >= 2) {
|
||||
blesspad = apad;
|
||||
- apad = newSVsv(apad);
|
||||
+ apad = sv_2mortal(newSVsv(apad));
|
||||
sv_x(aTHX_ apad, " ", 1, blesslen+2);
|
||||
}
|
||||
}
|
||||
|
||||
ipad = sv_x(aTHX_ Nullsv, SvPVX_const(style->xpad), SvCUR(style->xpad), level+1);
|
||||
+ sv_2mortal(ipad);
|
||||
|
||||
if (is_regex)
|
||||
{
|
||||
@@ -878,7 +879,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
realtype <= SVt_PVMG
|
||||
#endif
|
||||
) { /* scalar ref */
|
||||
- SV * const namesv = newSVpvs("${");
|
||||
+ SV * const namesv = sv_2mortal(newSVpvs("${"));
|
||||
sv_catpvn(namesv, name, namelen);
|
||||
sv_catpvs(namesv, "}");
|
||||
if (realpack) { /* blessed */
|
||||
@@ -892,7 +893,6 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
DD_dump(aTHX_ ival, SvPVX_const(namesv), SvCUR(namesv), retval, seenhv,
|
||||
postav, level+1, apad, style);
|
||||
}
|
||||
- SvREFCNT_dec(namesv);
|
||||
}
|
||||
else if (realtype == SVt_PVGV) { /* glob ref */
|
||||
SV * const namesv = newSVpvs("*{");
|
||||
@@ -908,9 +908,10 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
SSize_t ix = 0;
|
||||
const SSize_t ixmax = av_len((AV *)ival);
|
||||
|
||||
- SV * const ixsv = newSViv(0);
|
||||
+ SV * const ixsv = sv_2mortal(newSViv(0));
|
||||
/* allowing for a 24 char wide array index */
|
||||
New(0, iname, namelen+28, char);
|
||||
+ SAVEFREEPV(iname);
|
||||
(void) strlcpy(iname, name, namelen+28);
|
||||
inamelen = namelen;
|
||||
if (name[0] == '@') {
|
||||
@@ -940,7 +941,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
iname[inamelen++] = '-'; iname[inamelen++] = '>';
|
||||
}
|
||||
iname[inamelen++] = '['; iname[inamelen] = '\0';
|
||||
- totpad = newSVsv(style->sep);
|
||||
+ totpad = sv_2mortal(newSVsv(style->sep));
|
||||
sv_catsv(totpad, style->pad);
|
||||
sv_catsv(totpad, apad);
|
||||
|
||||
@@ -970,8 +971,12 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
}
|
||||
sv_catsv(retval, totpad);
|
||||
sv_catsv(retval, ipad);
|
||||
+ ENTER;
|
||||
+ SAVETMPS;
|
||||
DD_dump(aTHX_ elem, iname, ilen, retval, seenhv, postav,
|
||||
level+1, apad, style);
|
||||
+ FREETMPS;
|
||||
+ LEAVE;
|
||||
if (ix < ixmax || (style->trailingcomma && style->indent >= 1))
|
||||
sv_catpvs(retval, ",");
|
||||
}
|
||||
@@ -985,9 +990,6 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
sv_catpvs(retval, ")");
|
||||
else
|
||||
sv_catpvs(retval, "]");
|
||||
- SvREFCNT_dec(ixsv);
|
||||
- SvREFCNT_dec(totpad);
|
||||
- Safefree(iname);
|
||||
}
|
||||
else if (realtype == SVt_PVHV) {
|
||||
SV *totpad, *newapad;
|
||||
@@ -997,7 +999,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
SV *hval;
|
||||
AV *keys = NULL;
|
||||
|
||||
- SV * const iname = newSVpvn(name, namelen);
|
||||
+ SV * const iname = newSVpvn_flags(name, namelen, SVs_TEMP);
|
||||
if (name[0] == '%') {
|
||||
sv_catpvs(retval, "(");
|
||||
(SvPVX(iname))[0] = '$';
|
||||
@@ -1021,7 +1023,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
sv_catpvs(iname, "->");
|
||||
}
|
||||
sv_catpvs(iname, "{");
|
||||
- totpad = newSVsv(style->sep);
|
||||
+ totpad = sv_2mortal(newSVsv(style->sep));
|
||||
sv_catsv(totpad, style->pad);
|
||||
sv_catsv(totpad, apad);
|
||||
|
||||
@@ -1117,6 +1119,10 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
|
||||
sv_catsv(retval, totpad);
|
||||
sv_catsv(retval, ipad);
|
||||
+
|
||||
+ ENTER;
|
||||
+ SAVETMPS;
|
||||
+
|
||||
/* The (very)
|
||||
old logic was first to check utf8 flag, and if utf8 always
|
||||
call esc_q_utf8. This caused test to break under -Mutf8,
|
||||
@@ -1143,6 +1149,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
else {
|
||||
nticks = num_q(key, klen);
|
||||
New(0, nkey_buffer, klen+nticks+3, char);
|
||||
+ SAVEFREEPV(nkey_buffer);
|
||||
nkey = nkey_buffer;
|
||||
nkey[0] = '\'';
|
||||
if (nticks)
|
||||
@@ -1160,7 +1167,8 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
nlen = klen;
|
||||
sv_catpvn(retval, nkey, klen);
|
||||
}
|
||||
- sname = newSVsv(iname);
|
||||
+
|
||||
+ sname = sv_2mortal(newSVsv(iname));
|
||||
sv_catpvn(sname, nkey, nlen);
|
||||
sv_catpvs(sname, "}");
|
||||
|
||||
@@ -1168,7 +1176,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
if (style->indent >= 2) {
|
||||
char *extra;
|
||||
STRLEN elen = 0;
|
||||
- newapad = newSVsv(apad);
|
||||
+ newapad = sv_2mortal(newSVsv(apad));
|
||||
New(0, extra, klen+4+1, char);
|
||||
while (elen < (klen+4))
|
||||
extra[elen++] = ' ';
|
||||
@@ -1181,10 +1189,9 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
|
||||
DD_dump(aTHX_ hval, SvPVX_const(sname), SvCUR(sname), retval, seenhv,
|
||||
postav, level+1, newapad, style);
|
||||
- SvREFCNT_dec(sname);
|
||||
- Safefree(nkey_buffer);
|
||||
- if (style->indent >= 2)
|
||||
- SvREFCNT_dec(newapad);
|
||||
+
|
||||
+ FREETMPS;
|
||||
+ LEAVE;
|
||||
}
|
||||
if (i) {
|
||||
SV *opad = sv_x(aTHX_ Nullsv, SvPVX_const(style->xpad),
|
||||
@@ -1199,8 +1206,6 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
sv_catpvs(retval, ")");
|
||||
else
|
||||
sv_catpvs(retval, "}");
|
||||
- SvREFCNT_dec(iname);
|
||||
- SvREFCNT_dec(totpad);
|
||||
}
|
||||
else if (realtype == SVt_PVCV) {
|
||||
if (style->deparse) {
|
||||
@@ -1247,7 +1252,6 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
STRLEN plen, pticks;
|
||||
|
||||
if (style->indent >= 2) {
|
||||
- SvREFCNT_dec(apad);
|
||||
apad = blesspad;
|
||||
}
|
||||
sv_catpvs(retval, ", '");
|
||||
@@ -1276,7 +1280,6 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
sv_catpvs(retval, "()");
|
||||
}
|
||||
}
|
||||
- SvREFCNT_dec(ipad);
|
||||
}
|
||||
else {
|
||||
STRLEN i;
|
||||
@@ -1671,20 +1674,21 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
|
||||
if (style.indent >= 2 && !terse) {
|
||||
SV * const tmpsv = sv_x(aTHX_ NULL, " ", 1, SvCUR(name)+3);
|
||||
- newapad = newSVsv(apad);
|
||||
+ newapad = sv_2mortal(newSVsv(apad));
|
||||
sv_catsv(newapad, tmpsv);
|
||||
SvREFCNT_dec(tmpsv);
|
||||
}
|
||||
else
|
||||
newapad = apad;
|
||||
|
||||
+ ENTER;
|
||||
+ SAVETMPS;
|
||||
PUTBACK;
|
||||
DD_dump(aTHX_ val, SvPVX_const(name), SvCUR(name), valstr, seenhv,
|
||||
postav, 0, newapad, &style);
|
||||
SPAGAIN;
|
||||
-
|
||||
- if (style.indent >= 2 && !terse)
|
||||
- SvREFCNT_dec(newapad);
|
||||
+ FREETMPS;
|
||||
+ LEAVE;
|
||||
|
||||
postlen = av_len(postav);
|
||||
if (postlen >= 0 || !terse) {
|
||||
--
|
||||
2.25.4
|
||||
|
@ -1,167 +0,0 @@
|
||||
From d9c4b4ae5a1a17347ff5e3ecbf8e1d9da481f476 Mon Sep 17 00:00:00 2001
|
||||
From: David Mitchell <davem@iabyn.com>
|
||||
Date: Wed, 3 Apr 2019 13:23:24 +0100
|
||||
Subject: [PATCH] Data::Dumper - avoid leak on croak
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
v5.21.3-742-g19be3be696 added a facility to Dumper.xs to croak if the
|
||||
recursion level became too deep (1000 by default).
|
||||
|
||||
The trouble with this is that various parts of DD_dump() allocate
|
||||
temporary SVs and buffers, which will leak if DD_dump() unceremoniously
|
||||
just croaks().
|
||||
|
||||
This currently manifests as dist/Data-Dumper/t/recurse.t failing under
|
||||
Address Sanitiser.
|
||||
|
||||
This commit makes the depth checking code just set a sticky 'too deep'
|
||||
boolean flag, and
|
||||
a) on entry, DD_dump() just returns immediately if the flag is set;
|
||||
b) the flag is checked by the top-level called of DD_dump() and croaks
|
||||
if set.
|
||||
|
||||
So the net effect is to defer croaking until the dump is complete,
|
||||
and avoid any further recursion once the flag is set.
|
||||
|
||||
This is a bit of a quick fix. More long-term solutions would be to
|
||||
convert DD_dump() to be iterative rather than recursive, and/or make
|
||||
sure all temporary SVs and buffers are suitably anchored somewhere so
|
||||
that they get cleaned up on croak.
|
||||
|
||||
Petr Písař: Ported from 6d65cb5d847ac93680949c4fa02111808207fbdc in
|
||||
perl git tree.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
Dumper.pm | 6 +++---
|
||||
Dumper.xs | 27 ++++++++++++++++++++-------
|
||||
2 files changed, 23 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/Dumper.pm b/Dumper.pm
|
||||
index 40aeb7d..06af4c4 100644
|
||||
--- a/Dumper.pm
|
||||
+++ b/Dumper.pm
|
||||
@@ -10,7 +10,7 @@
|
||||
package Data::Dumper;
|
||||
|
||||
BEGIN {
|
||||
- $VERSION = '2.173'; # Don't forget to set version and release
|
||||
+ $VERSION = '2.174'; # Don't forget to set version and release
|
||||
} # date in POD below!
|
||||
|
||||
#$| = 1;
|
||||
@@ -1461,13 +1461,13 @@ be to use the C<Sortkeys> filter of Data::Dumper.
|
||||
|
||||
Gurusamy Sarathy gsar@activestate.com
|
||||
|
||||
-Copyright (c) 1996-2017 Gurusamy Sarathy. All rights reserved.
|
||||
+Copyright (c) 1996-2019 Gurusamy Sarathy. All rights reserved.
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the same terms as Perl itself.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
-Version 2.173
|
||||
+Version 2.174
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
diff --git a/Dumper.xs b/Dumper.xs
|
||||
index 7f0b027..a324cb6 100644
|
||||
--- a/Dumper.xs
|
||||
+++ b/Dumper.xs
|
||||
@@ -61,9 +61,10 @@
|
||||
#endif
|
||||
|
||||
/* This struct contains almost all the user's desired configuration, and it
|
||||
- * is treated as constant by the recursive function. This arrangement has
|
||||
- * the advantage of needing less memory than passing all of them on the
|
||||
- * stack all the time (as was the case in an earlier implementation). */
|
||||
+ * is treated as mostly constant (except for maxrecursed) by the recursive
|
||||
+ * function. This arrangement has the advantage of needing less memory
|
||||
+ * than passing all of them on the stack all the time (as was the case in
|
||||
+ * an earlier implementation). */
|
||||
typedef struct {
|
||||
SV *pad;
|
||||
SV *xpad;
|
||||
@@ -74,6 +75,7 @@ typedef struct {
|
||||
SV *toaster;
|
||||
SV *bless;
|
||||
IV maxrecurse;
|
||||
+ bool maxrecursed; /* at some point we exceeded the maximum recursion level */
|
||||
I32 indent;
|
||||
I32 purity;
|
||||
I32 deepcopy;
|
||||
@@ -97,7 +99,7 @@ static bool safe_decimal_number(const char *p, STRLEN len);
|
||||
static SV *sv_x (pTHX_ SV *sv, const char *str, STRLEN len, I32 n);
|
||||
static I32 DD_dump (pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval,
|
||||
HV *seenhv, AV *postav, const I32 level, SV *apad,
|
||||
- const Style *style);
|
||||
+ Style *style);
|
||||
|
||||
#ifndef HvNAME_get
|
||||
#define HvNAME_get HvNAME
|
||||
@@ -615,7 +617,7 @@ deparsed_output(pTHX_ SV *val)
|
||||
*/
|
||||
static I32
|
||||
DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
- AV *postav, const I32 level, SV *apad, const Style *style)
|
||||
+ AV *postav, const I32 level, SV *apad, Style *style)
|
||||
{
|
||||
char tmpbuf[128];
|
||||
Size_t i;
|
||||
@@ -642,6 +644,9 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
if (!val)
|
||||
return 0;
|
||||
|
||||
+ if (style->maxrecursed)
|
||||
+ return 0;
|
||||
+
|
||||
/* If the output buffer has less than some arbitrary amount of space
|
||||
remaining, then enlarge it. For the test case (25M of output),
|
||||
*1.1 was slower, *2.0 was the same, so the first guess of 1.5 is
|
||||
@@ -793,7 +798,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
}
|
||||
|
||||
if (style->maxrecurse > 0 && level >= style->maxrecurse) {
|
||||
- croak("Recursion limit of %" IVdf " exceeded", style->maxrecurse);
|
||||
+ style->maxrecursed = TRUE;
|
||||
}
|
||||
|
||||
if (realpack && !no_bless) { /* we have a blessed ref */
|
||||
@@ -1528,6 +1533,7 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
style.indent = 2;
|
||||
style.quotekeys = 1;
|
||||
style.maxrecurse = 1000;
|
||||
+ style.maxrecursed = FALSE;
|
||||
style.purity = style.deepcopy = style.useqq = style.maxdepth
|
||||
= style.use_sparse_seen_hash = style.trailingcomma = 0;
|
||||
style.pad = style.xpad = style.sep = style.pair = style.sortkeys
|
||||
@@ -1675,7 +1681,7 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
DD_dump(aTHX_ val, SvPVX_const(name), SvCUR(name), valstr, seenhv,
|
||||
postav, 0, newapad, &style);
|
||||
SPAGAIN;
|
||||
-
|
||||
+
|
||||
if (style.indent >= 2 && !terse)
|
||||
SvREFCNT_dec(newapad);
|
||||
|
||||
@@ -1715,6 +1721,13 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
}
|
||||
SvREFCNT_dec(postav);
|
||||
SvREFCNT_dec(valstr);
|
||||
+
|
||||
+ /* we defer croaking until here so that temporary SVs and
|
||||
+ * buffers won't be leaked */
|
||||
+ if (style.maxrecursed)
|
||||
+ croak("Recursion limit of %" IVdf " exceeded",
|
||||
+ style.maxrecurse);
|
||||
+
|
||||
}
|
||||
else
|
||||
croak("Call to new() method failed to return HASH ref");
|
||||
--
|
||||
2.20.1
|
||||
|
@ -1,56 +0,0 @@
|
||||
From 65ec73b1bc79648a2daeb494552ce0b0b90348d7 Mon Sep 17 00:00:00 2001
|
||||
From: Tony Cook <tony@develop-help.com>
|
||||
Date: Mon, 10 Aug 2020 16:26:30 +1000
|
||||
Subject: [PATCH 1/3] Data::Dumper: don't leak the working retval
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
do this by mortalizing the SV on creation, rather than when we
|
||||
push it on the stack
|
||||
|
||||
Petr Písař: Ported to Data-Dumper-2.173 from
|
||||
41463160be4baa0d81d9d8297508a1b9bdcaa206 perl commit.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
Dumper.xs | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/Dumper.xs b/Dumper.xs
|
||||
index a324cb6..f91145a 100644
|
||||
--- a/Dumper.xs
|
||||
+++ b/Dumper.xs
|
||||
@@ -1541,7 +1541,7 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
seenhv = NULL;
|
||||
name = sv_newmortal();
|
||||
|
||||
- retval = newSVpvs("");
|
||||
+ retval = newSVpvs_flags("", SVs_TEMP);
|
||||
if (SvROK(href)
|
||||
&& (hv = (HV*)SvRV((SV*)href))
|
||||
&& SvTYPE(hv) == SVt_PVHV) {
|
||||
@@ -1714,9 +1714,9 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
}
|
||||
SvPVCLEAR(valstr);
|
||||
if (gimme == G_ARRAY) {
|
||||
- XPUSHs(sv_2mortal(retval));
|
||||
+ XPUSHs(retval);
|
||||
if (i < imax) /* not the last time thro ? */
|
||||
- retval = newSVpvs("");
|
||||
+ retval = newSVpvs_flags("", SVs_TEMP);
|
||||
}
|
||||
}
|
||||
SvREFCNT_dec(postav);
|
||||
@@ -1732,7 +1732,7 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
else
|
||||
croak("Call to new() method failed to return HASH ref");
|
||||
if (gimme != G_ARRAY)
|
||||
- XPUSHs(sv_2mortal(retval));
|
||||
+ XPUSHs(retval);
|
||||
}
|
||||
|
||||
SV *
|
||||
--
|
||||
2.25.4
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 21e67795792e5e1d25bcbd3b167ed18d0d6dc7b4 Mon Sep 17 00:00:00 2001
|
||||
From: Tony Cook <tony@develop-help.com>
|
||||
Date: Tue, 11 Aug 2020 10:46:38 +1000
|
||||
Subject: [PATCH 2/3] make postav and valstr mortal so they're freed soonish
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
these can leak if the value being dumped (or any part of it)
|
||||
had get magic and that magic throws an exception.
|
||||
|
||||
Several other SVs can also leak in that case, but cleaning those up
|
||||
is more complex.
|
||||
|
||||
Petr Písař: Ported to Data-Dumper-2.173 from
|
||||
b98a3a6d08f681353d0b357fd1cce437c93656e7 perl commit.
|
||||
|
||||
Signed-off-by: Petr Písař <ppisar@redhat.com>
|
||||
---
|
||||
Dumper.xs | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Dumper.xs b/Dumper.xs
|
||||
index f91145a..d4b34ad 100644
|
||||
--- a/Dumper.xs
|
||||
+++ b/Dumper.xs
|
||||
@@ -1613,12 +1613,13 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
style.sortkeys = &PL_sv_yes;
|
||||
}
|
||||
postav = newAV();
|
||||
+ sv_2mortal((SV*)postav);
|
||||
|
||||
if (todumpav)
|
||||
imax = av_len(todumpav);
|
||||
else
|
||||
imax = -1;
|
||||
- valstr = newSVpvs("");
|
||||
+ valstr = newSVpvs_flags("", SVs_TEMP);
|
||||
for (i = 0; i <= imax; ++i) {
|
||||
SV *newapad;
|
||||
|
||||
@@ -1719,8 +1720,6 @@ Data_Dumper_Dumpxs(href, ...)
|
||||
retval = newSVpvs_flags("", SVs_TEMP);
|
||||
}
|
||||
}
|
||||
- SvREFCNT_dec(postav);
|
||||
- SvREFCNT_dec(valstr);
|
||||
|
||||
/* we defer croaking until here so that temporary SVs and
|
||||
* buffers won't be leaked */
|
||||
--
|
||||
2.25.4
|
||||
|
@ -0,0 +1,274 @@
|
||||
From d3b09ae0076981fb5ef8a979fa387105278a7234 Mon Sep 17 00:00:00 2001
|
||||
From: Jitka Plesnikova <jplesnik@redhat.com>
|
||||
Date: Wed, 11 May 2022 11:01:46 +0200
|
||||
Subject: [PATCH] Upgrade to 2.184
|
||||
|
||||
---
|
||||
Dumper.pm | 51 +++++++++++++++++++--------------------------------
|
||||
Dumper.xs | 10 ++++------
|
||||
t/dumper.t | 52 ++++++++++++++++------------------------------------
|
||||
3 files changed, 39 insertions(+), 74 deletions(-)
|
||||
|
||||
diff --git a/Dumper.pm b/Dumper.pm
|
||||
index 3b1bb75..ba61ffe 100644
|
||||
--- a/Dumper.pm
|
||||
+++ b/Dumper.pm
|
||||
@@ -29,7 +29,7 @@ our ( $Indent, $Trailingcomma, $Purity, $Pad, $Varname, $Useqq, $Terse, $Freezer
|
||||
our ( @ISA, @EXPORT, @EXPORT_OK, $VERSION );
|
||||
|
||||
BEGIN {
|
||||
- $VERSION = '2.183'; # Don't forget to set version and release
|
||||
+ $VERSION = '2.184'; # Don't forget to set version and release
|
||||
# date in POD below!
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@@ -740,15 +740,15 @@ my %esc = (
|
||||
"\e" => "\\e",
|
||||
);
|
||||
|
||||
-my $low_controls = ($IS_ASCII)
|
||||
-
|
||||
- # This includes \177, because traditionally it has been
|
||||
- # output as octal, even though it isn't really a "low"
|
||||
- # control
|
||||
- ? qr/[\0-\x1f\177]/
|
||||
-
|
||||
- # EBCDIC low controls.
|
||||
- : qr/[\0-\x3f]/;
|
||||
+# The low controls are considered to be everything below SPACE, plus the
|
||||
+# outlier \c? control (but that wasn't properly in existence in early perls,
|
||||
+# so reconstruct its value here. This abandons EBCDIC support for this
|
||||
+# character for perls below 5.8)
|
||||
+my $low_controls = join "", map { quotemeta chr $_ } 0.. (ord(" ") - 1);
|
||||
+$low_controls .= ($] < 5.008 || $IS_ASCII)
|
||||
+ ? "\x7f"
|
||||
+ : chr utf8::unicode_to_native(0x9F);
|
||||
+my $low_controls_re = qr/[$low_controls]/;
|
||||
|
||||
# put a string value in double quotes
|
||||
sub qquote {
|
||||
@@ -758,19 +758,10 @@ sub qquote {
|
||||
# This efficiently changes the high ordinal characters to \x{} if the utf8
|
||||
# flag is on. On ASCII platforms, the high ordinals are all the
|
||||
# non-ASCII's. On EBCDIC platforms, we don't include in these the non-ASCII
|
||||
- # controls whose ordinals are less than SPACE, excluded below by the range
|
||||
- # \0-\x3f. On ASCII platforms this range just compiles as part of :ascii:.
|
||||
- # On EBCDIC platforms, there is just one outlier high ordinal control, and
|
||||
- # it gets output as \x{}.
|
||||
+ # controls.
|
||||
my $bytes; { use bytes; $bytes = length }
|
||||
- s/([^[:ascii:]\0-\x3f])/sprintf("\\x{%x}",ord($1))/ge
|
||||
- if $bytes > length
|
||||
-
|
||||
- # The above doesn't get the EBCDIC outlier high ordinal control when
|
||||
- # the string is UTF-8 but there are no UTF-8 variant characters in it.
|
||||
- # We want that to come out as \x{} anyway. We need is_utf8() to do
|
||||
- # this.
|
||||
- || (! $IS_ASCII && utf8::is_utf8($_));
|
||||
+ s/([^[:ascii:]$low_controls])/sprintf("\\x{%x}",ord($1))/ge
|
||||
+ if $bytes > length;
|
||||
|
||||
return qq("$_") unless /[[:^print:]]/; # fast exit if only printables
|
||||
|
||||
@@ -779,21 +770,17 @@ sub qquote {
|
||||
s/([\a\b\t\n\f\r\e])/$esc{$1}/g;
|
||||
|
||||
# no need for 3 digits in escape for octals not followed by a digit.
|
||||
- s/($low_controls)(?!\d)/'\\'.sprintf('%o',ord($1))/eg;
|
||||
+ s/($low_controls_re)(?!\d)/'\\'.sprintf('%o',ord($1))/eg;
|
||||
|
||||
# But otherwise use 3 digits
|
||||
- s/($low_controls)/'\\'.sprintf('%03o',ord($1))/eg;
|
||||
+ s/($low_controls_re)/'\\'.sprintf('%03o',ord($1))/eg;
|
||||
|
||||
# all but last branch below not supported --BEHAVIOR SUBJECT TO CHANGE--
|
||||
my $high = shift || "";
|
||||
if ($high eq "iso8859") { # Doesn't escape the Latin1 printables
|
||||
- if ($IS_ASCII) {
|
||||
- s/([\200-\240])/'\\'.sprintf('%o',ord($1))/eg;
|
||||
- }
|
||||
- else {
|
||||
- my $high_control = utf8::unicode_to_native(0x9F);
|
||||
- s/$high_control/sprintf('\\%o',ord($1))/eg;
|
||||
- }
|
||||
+ # Could use /u and [:cntrl:] etc, if khw were confident it worked in
|
||||
+ # early early perls
|
||||
+ s/([\200-\240])/'\\'.sprintf('%o',ord($1))/eg if $IS_ASCII;
|
||||
} elsif ($high eq "utf8") {
|
||||
# Some discussion of what to do here is in
|
||||
# https://rt.perl.org/Ticket/Display.html?id=113088
|
||||
@@ -1461,7 +1448,7 @@ modify it under the same terms as Perl itself.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
-Version 2.183
|
||||
+Version 2.184
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
diff --git a/Dumper.xs b/Dumper.xs
|
||||
index 0eaa6c9..8bd6397 100644
|
||||
--- a/Dumper.xs
|
||||
+++ b/Dumper.xs
|
||||
@@ -287,14 +287,13 @@ esc_q_utf8(pTHX_ SV* sv, const char *src, STRLEN slen, I32 do_utf8, I32 useqq)
|
||||
* outputs the raw char */
|
||||
normal++;
|
||||
}
|
||||
- else { /* Is qq, low ordinal, non-printable. Output escape
|
||||
- * sequences */
|
||||
+ else { /* Is qq, non-printable. Output escape sequences */
|
||||
if ( k == '\a' || k == '\b' || k == '\t' || k == '\n' || k == '\r'
|
||||
|| k == '\f' || k == ESC_NATIVE)
|
||||
{
|
||||
grow += 2; /* 1 char plus backslash */
|
||||
}
|
||||
- else /* The other low ordinals are output as an octal escape
|
||||
+ else /* The other non-printable controls are output as an octal escape
|
||||
* sequence */
|
||||
if (s + 1 >= send || isDIGIT(*(s+1))) {
|
||||
/* When the following character is a digit, use 3 octal digits
|
||||
@@ -341,9 +340,8 @@ esc_q_utf8(pTHX_ SV* sv, const char *src, STRLEN slen, I32 do_utf8, I32 useqq)
|
||||
}
|
||||
|
||||
/* Here 1) isn't UTF-8; or
|
||||
- * 2) the current character is ASCII; or
|
||||
- * 3) it is an EBCDIC platform and is a low ordinal
|
||||
- * non-ASCII control.
|
||||
+ * 2) the current character is represented as the same single
|
||||
+ * byte regardless of the string's UTF-8ness
|
||||
* In each case the character occupies just one byte */
|
||||
k = *(U8*)s;
|
||||
increment = 1;
|
||||
diff --git a/t/dumper.t b/t/dumper.t
|
||||
index 3cd86a6..80b2c8e 100644
|
||||
--- a/t/dumper.t
|
||||
+++ b/t/dumper.t
|
||||
@@ -77,8 +77,8 @@ sub convert_to_native {
|
||||
$index = utf8::unicode_to_native(ord eval "\"$2\"");
|
||||
|
||||
# But low hex numbers are always in octal. These are all
|
||||
- # controls.
|
||||
- my $format = ($index < ord(" "))
|
||||
+ # controls. The outlier \c? control is also in octal.
|
||||
+ my $format = ($index < ord(" ") || $index == ord("\c?"))
|
||||
? "\\%o"
|
||||
: "\\x{%x}";
|
||||
$replacement = sprintf($format, $index);
|
||||
@@ -1659,8 +1659,8 @@ EOW
|
||||
# "\\x{41f}",
|
||||
# qr/\x{8b80}/,
|
||||
# qr/\x{41f}/,
|
||||
-# qr/\x{e4}/,
|
||||
-# '\xE4'
|
||||
+# qr/\x{b6}/,
|
||||
+# '\xb6'
|
||||
#];
|
||||
EOW
|
||||
if ($] lt '5.010001') {
|
||||
@@ -1671,9 +1671,9 @@ EOW
|
||||
$want =~ s{/(,?)$}{/u$1}mg;
|
||||
}
|
||||
my $want_xs = $want;
|
||||
- $want_xs =~ s/'\xE4'/"\\x{e4}"/;
|
||||
- $want_xs =~ s<([^\0-\177])> <sprintf '\\x{%x}', ord $1>ge;
|
||||
- TEST_BOTH(qq(Data::Dumper->Dumpxs([ [qq/\x{41f}/, qr/\x{8b80}/, qr/\x{41f}/, qr/\x{e4}/, "\xE4"] ])),
|
||||
+ $want_xs =~ s/'\xb6'/"\\x{b6}"/;
|
||||
+ $want_xs =~ s<([[:^ascii:]])> <sprintf '\\x{%x}', ord $1>ge;
|
||||
+ TEST_BOTH(qq(Data::Dumper->Dumpxs([ [qq/\x{41f}/, qr/\x{8b80}/, qr/\x{41f}/, qr/\x{b6}/, "\xb6"] ])),
|
||||
"string with Unicode + regexp with Unicode",
|
||||
$want, $want_xs);
|
||||
}
|
||||
@@ -1715,7 +1715,7 @@ EOW
|
||||
# qr/ \x{203d}\\/ /,
|
||||
# qr/ \\\x{203d}\\/ /,
|
||||
# qr/ \\\x{203d}$bs:\\/ /,
|
||||
-# '\xA3'
|
||||
+# '\xB6'
|
||||
#];
|
||||
EOW
|
||||
if ($] lt '5.010001') {
|
||||
@@ -1726,9 +1726,9 @@ EOW
|
||||
$want =~ s{/(,?)$}{/u$1}mg;
|
||||
}
|
||||
my $want_xs = $want;
|
||||
- $want_xs =~ s/'\x{A3}'/"\\x{a3}"/;
|
||||
+ $want_xs =~ s/'\x{B6}'/"\\x{b6}"/;
|
||||
$want_xs =~ s/\x{203D}/\\x{203d}/g;
|
||||
- TEST_BOTH(qq(Data::Dumper->Dumpxs([ [ '\x{2e18}', qr! \x{203d}/ !, qr! \\\x{203d}/ !, qr! \\\x{203d}$bs:/ !, "\xa3"] ])),
|
||||
+ TEST_BOTH(qq(Data::Dumper->Dumpxs([ [ '\x{2e18}', qr! \x{203d}/ !, qr! \\\x{203d}/ !, qr! \\\x{203d}$bs:/ !, "\xb6"] ])),
|
||||
"github #18614, github #18764, perl #58608 corner cases",
|
||||
$want, $want_xs);
|
||||
}
|
||||
@@ -1743,13 +1743,13 @@ EOW
|
||||
# qr/^\$/,
|
||||
# qr/${dollar}foo/,
|
||||
# qr/\\\$foo/,
|
||||
-# qr/$dollar \x{A3} /u,
|
||||
+# qr/$dollar \x{B6} /u,
|
||||
# qr/$dollar \x{203d} /u,
|
||||
# qr/\\\$ \x{203d} /u,
|
||||
# qr/\\\\$dollar \x{203d} /u,
|
||||
# qr/ \$| \x{203d} /u,
|
||||
# qr/ (\$) \x{203d} /u,
|
||||
-# '\xA3'
|
||||
+# '\xB6'
|
||||
#];
|
||||
EOW
|
||||
if ($] lt '5.014') {
|
||||
@@ -1760,8 +1760,8 @@ EOW
|
||||
$want =~ s!/,!)/,!g;
|
||||
}
|
||||
my $want_xs = $want;
|
||||
- $want_xs =~ s/'\x{A3}'/"\\x{a3}"/;
|
||||
- $want_xs =~ s/\x{A3}/\\x{a3}/;
|
||||
+ $want_xs =~ s/'\x{B6}'/"\\x{b6}"/;
|
||||
+ $want_xs =~ s/\x{B6}/\\x{b6}/;
|
||||
$want_xs =~ s/\x{203D}/\\x{203d}/g;
|
||||
my $have = <<"EOT";
|
||||
Data::Dumper->Dumpxs([ [
|
||||
@@ -1770,13 +1770,13 @@ Data::Dumper->Dumpxs([ [
|
||||
qr'^\$',
|
||||
qr'\$foo',
|
||||
qr/\\\$foo/,
|
||||
- qr'\$ \x{A3} ',
|
||||
+ qr'\$ \x{B6} ',
|
||||
qr'\$ \x{203d} ',
|
||||
qr/\\\$ \x{203d} /,
|
||||
qr'\\\\\$ \x{203d} ',
|
||||
qr/ \$| \x{203d} /,
|
||||
qr/ (\$) \x{203d} /,
|
||||
- '\xA3'
|
||||
+ '\xB6'
|
||||
] ]);
|
||||
EOT
|
||||
TEST_BOTH($have, "CPAN #84569", $want, $want_xs);
|
||||
@@ -1808,26 +1808,6 @@ EOW
|
||||
"name of code in *foo",
|
||||
$want);
|
||||
}
|
||||
-#############
|
||||
-
|
||||
-{
|
||||
- # There is special code to handle the single control that in EBCDIC is
|
||||
- # not in the block with all the other controls, when it is UTF-8 and
|
||||
- # there are no variants in it (All controls in EBCDIC are invariant.)
|
||||
- # This tests that. There is no harm in testing this works on ASCII,
|
||||
- # and is better to not have split code paths.
|
||||
- my $outlier = chr utf8::unicode_to_native(0x9F);
|
||||
- my $outlier_hex = sprintf "%x", ord $outlier;
|
||||
- my $want = <<EOT;
|
||||
-#\$VAR1 = \"\\x{$outlier_hex}\";
|
||||
-EOT
|
||||
- $foo = "$outlier\x{100}";
|
||||
- chop $foo;
|
||||
- local $Data::Dumper::Useqq = 1;
|
||||
- TEST_BOTH (q(Data::Dumper::DumperX($foo)),
|
||||
- 'EBCDIC outlier control: DumperX',
|
||||
- $want);
|
||||
-}
|
||||
############# [perl #124091]
|
||||
{
|
||||
my $want = <<'EOT';
|
||||
--
|
||||
2.34.3
|
||||
|
@ -0,0 +1,168 @@
|
||||
From 6e00a4556565aa46119d4ab858dc8ff3f1c03f99 Mon Sep 17 00:00:00 2001
|
||||
From: Jitka Plesnikova <jplesnik@redhat.com>
|
||||
Date: Tue, 16 May 2023 12:56:43 +0200
|
||||
Subject: [PATCH] Upgrade to 2.188
|
||||
|
||||
---
|
||||
Dumper.pm | 15 +++++++++++----
|
||||
Dumper.xs | 25 +++++++++++++++++--------
|
||||
Makefile.PL | 1 -
|
||||
t/dumper.t | 20 ++++++++++++++++++++
|
||||
4 files changed, 48 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/Dumper.pm b/Dumper.pm
|
||||
index ba61ffe..bb6d3ca 100644
|
||||
--- a/Dumper.pm
|
||||
+++ b/Dumper.pm
|
||||
@@ -18,6 +18,7 @@ use 5.008_001;
|
||||
require Exporter;
|
||||
|
||||
use constant IS_PRE_516_PERL => $] < 5.016;
|
||||
+use constant SUPPORTS_CORE_BOOLS => defined &builtin::is_bool;
|
||||
|
||||
use Carp ();
|
||||
|
||||
@@ -29,7 +30,7 @@ our ( $Indent, $Trailingcomma, $Purity, $Pad, $Varname, $Useqq, $Terse, $Freezer
|
||||
our ( @ISA, @EXPORT, @EXPORT_OK, $VERSION );
|
||||
|
||||
BEGIN {
|
||||
- $VERSION = '2.184'; # Don't forget to set version and release
|
||||
+ $VERSION = '2.188'; # Don't forget to set version and release
|
||||
# date in POD below!
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@@ -551,6 +552,12 @@ sub _dump {
|
||||
elsif (!defined($val)) {
|
||||
$out .= "undef";
|
||||
}
|
||||
+ elsif (SUPPORTS_CORE_BOOLS && do {
|
||||
+ BEGIN { SUPPORTS_CORE_BOOLS and warnings->unimport("experimental::builtin") }
|
||||
+ builtin::is_bool($val)
|
||||
+ }) {
|
||||
+ $out .= $val ? '!!1' : '!!0';
|
||||
+ }
|
||||
# This calls the XSUB _vstring (if the XS code is loaded). I'm not *sure* if
|
||||
# if belongs in the "Pure Perl" implementation. It sort of depends on what
|
||||
# was meant by "Pure Perl", as this subroutine already relies Scalar::Util
|
||||
@@ -859,7 +866,7 @@ Data::Dumper - stringified perl data structures, suitable for both printing and
|
||||
}
|
||||
|
||||
# OO usage
|
||||
- $d = Data::Dumper->new([$foo, $bar], [qw(foo *ary)]);
|
||||
+ my $d = Data::Dumper->new([$foo, $bar], [qw(foo *ary)]);
|
||||
...
|
||||
print $d->Dump;
|
||||
...
|
||||
@@ -884,7 +891,7 @@ to substructures within C<$VAR>I<n> will be appropriately labeled using arrow
|
||||
notation. You can specify names for individual values to be dumped if you
|
||||
use the C<Dump()> method, or you can change the default C<$VAR> prefix to
|
||||
something else. See C<$Data::Dumper::Varname> and C<$Data::Dumper::Terse>
|
||||
-below.
|
||||
+in L</Configuration Variables or Methods> below.
|
||||
|
||||
The default output of self-referential structures can be C<eval>ed, but the
|
||||
nested references to C<$VAR>I<n> will be undefined, since a recursive
|
||||
@@ -1448,7 +1455,7 @@ modify it under the same terms as Perl itself.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
-Version 2.184
|
||||
+Version 2.188
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
diff --git a/Dumper.xs b/Dumper.xs
|
||||
index 8bd6397..4d54ba1 100644
|
||||
--- a/Dumper.xs
|
||||
+++ b/Dumper.xs
|
||||
@@ -2,13 +2,11 @@
|
||||
#include "EXTERN.h"
|
||||
#include "perl.h"
|
||||
#include "XSUB.h"
|
||||
-#ifdef USE_PPPORT_H
|
||||
-# define NEED_my_snprintf
|
||||
-# define NEED_my_sprintf
|
||||
-# define NEED_sv_2pv_flags
|
||||
-# define NEED_utf8_to_uvchr_buf
|
||||
-# include "ppport.h"
|
||||
-#endif
|
||||
+#define NEED_my_snprintf
|
||||
+#define NEED_my_sprintf
|
||||
+#define NEED_sv_2pv_flags
|
||||
+#define NEED_utf8_to_uvchr_buf
|
||||
+#include "ppport.h"
|
||||
|
||||
#ifndef strlcpy
|
||||
# ifdef my_strlcpy
|
||||
@@ -1279,6 +1277,17 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
}
|
||||
}
|
||||
|
||||
+#ifdef SvIsBOOL
|
||||
+ if (SvIsBOOL(val)) {
|
||||
+ if (SvTRUE(val)) {
|
||||
+ sv_catpvs(retval, "!!1");
|
||||
+ }
|
||||
+ else {
|
||||
+ sv_catpvs(retval, "!!0");
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+#endif
|
||||
if (DD_is_integer(val)) {
|
||||
STRLEN len;
|
||||
if (SvIsUV(val))
|
||||
@@ -1315,7 +1324,7 @@ DD_dump(pTHX_ SV *val, const char *name, STRLEN namelen, SV *retval, HV *seenhv,
|
||||
SvCUR_set(retval, SvCUR(retval)+2);
|
||||
i = 3 + esc_q_utf8(aTHX_ retval, c, i,
|
||||
#ifdef GvNAMEUTF8
|
||||
- !!GvNAMEUTF8(val), style->useqq
|
||||
+ cBOOL(GvNAMEUTF8(val)), style->useqq
|
||||
#else
|
||||
0, style->useqq || globname_supra_ascii(c, i)
|
||||
#endif
|
||||
diff --git a/Makefile.PL b/Makefile.PL
|
||||
index afbdba6..2920b46 100644
|
||||
--- a/Makefile.PL
|
||||
+++ b/Makefile.PL
|
||||
@@ -18,6 +18,5 @@ WriteMakefile(
|
||||
VERSION_FROM => 'Dumper.pm',
|
||||
ABSTRACT_FROM => 'Dumper.pm',
|
||||
$] <= 5.011000 ? ( INSTALLDIRS => 'perl' ) : (),
|
||||
- ((grep { $_ eq 'PERL_CORE=1' } @ARGV) ? () : ('DEFINE' => '-DUSE_PPPORT_H')),
|
||||
@extra,
|
||||
);
|
||||
diff --git a/t/dumper.t b/t/dumper.t
|
||||
index 80b2c8e..55a997c 100644
|
||||
--- a/t/dumper.t
|
||||
+++ b/t/dumper.t
|
||||
@@ -1522,6 +1522,26 @@ EOT
|
||||
$want);
|
||||
}
|
||||
|
||||
+#############
|
||||
+{
|
||||
+ if (!Data::Dumper::SUPPORTS_CORE_BOOLS) {
|
||||
+ SKIP_BOTH("Core booleans not supported on older perls");
|
||||
+ last;
|
||||
+ }
|
||||
+ my $want = <<'EOT';
|
||||
+#$VAR1 = [
|
||||
+# !!1,
|
||||
+# !!0
|
||||
+#];
|
||||
+EOT
|
||||
+
|
||||
+ $foo = [ !!1, !!0 ];
|
||||
+ TEST_BOTH(q(Data::Dumper::DumperX($foo)),
|
||||
+ 'Booleans',
|
||||
+ $want);
|
||||
+}
|
||||
+
|
||||
+
|
||||
#############
|
||||
{
|
||||
# If XS cannot load, the pure-Perl version cannot deparse vstrings with
|
||||
--
|
||||
2.40.1
|
||||
|
@ -0,0 +1,43 @@
|
||||
From 06f67e3ce7e18b23f325851ba04200e4dc9642e3 Mon Sep 17 00:00:00 2001
|
||||
From: Jitka Plesnikova <jplesnik@redhat.com>
|
||||
Date: Tue, 7 May 2024 15:02:41 +0200
|
||||
Subject: [PATCH] Upgrade to 2.189
|
||||
|
||||
---
|
||||
Dumper.pm | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/Dumper.pm b/Dumper.pm
|
||||
index bb6d3ca..ca965eb 100644
|
||||
--- a/Dumper.pm
|
||||
+++ b/Dumper.pm
|
||||
@@ -30,7 +30,7 @@ our ( $Indent, $Trailingcomma, $Purity, $Pad, $Varname, $Useqq, $Terse, $Freezer
|
||||
our ( @ISA, @EXPORT, @EXPORT_OK, $VERSION );
|
||||
|
||||
BEGIN {
|
||||
- $VERSION = '2.188'; # Don't forget to set version and release
|
||||
+ $VERSION = '2.189'; # Don't forget to set version and release
|
||||
# date in POD below!
|
||||
|
||||
@ISA = qw(Exporter);
|
||||
@@ -924,7 +924,7 @@ for details.
|
||||
Returns a newly created C<Data::Dumper> object. The first argument is an
|
||||
anonymous array of values to be dumped. The optional second argument is an
|
||||
anonymous array of names for the values. The names need not have a leading
|
||||
-C<$> sign, and must be comprised of alphanumeric characters. You can begin
|
||||
+C<$> sign, and must be composed of alphanumeric characters. You can begin
|
||||
a name with a C<*> to specify that the dereferenced type must be dumped
|
||||
instead of the reference itself, for ARRAY and HASH references.
|
||||
|
||||
@@ -1455,7 +1455,7 @@ modify it under the same terms as Perl itself.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
-Version 2.188
|
||||
+Version 2.189
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
--
|
||||
2.45.0
|
||||
|
Loading…
Reference in new issue