perl/perl-5.32.1-Perl_do_sv_dump-handle-PL_strtab.patch
DistroBaker 1e2dd3a4b9 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/perl.git#d4be40cd41e70e291f7a52836675d54e4c6e0142
2021-04-06 12:25:23 +00:00

45 lines
1.7 KiB
Diff

From 2ce7bf1ad5fd7aee21975b3dd1c8dceef3aab7e4 Mon Sep 17 00:00:00 2001
From: David Mitchell <davem@iabyn.com>
Date: Tue, 9 Mar 2021 16:42:11 +0000
Subject: [PATCH] Perl_do_sv_dump(): handle PL_strtab
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
When dumping this special hash, the values in the HE entry are refcounts
rather than SV pointers. sv_dump() used to crash here.
Petr Písař: Ported to 5.32.1 from upstream
a9bb6a62ae45bb372a5cca98a76d1a79edd89ccb.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
dump.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dump.c b/dump.c
index f03c3f6..0f15d77 100644
--- a/dump.c
+++ b/dump.c
@@ -2224,8 +2224,15 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
PerlIO_printf(file, "[UTF8 \"%s\"] ", sv_uni_display(d, keysv, 6 * SvCUR(keysv), UNI_DISPLAY_QQ));
if (HvEITER_get(hv) == he)
PerlIO_printf(file, "[CURRENT] ");
- PerlIO_printf(file, "HASH = 0x%" UVxf "\n", (UV) hash);
- do_sv_dump(level+1, file, elt, nest+1, maxnest, dumpops, pvlim);
+ PerlIO_printf(file, "HASH = 0x%" UVxf, (UV) hash);
+
+ if (sv == (SV*)PL_strtab)
+ PerlIO_printf(file, " REFCNT = 0x%" UVxf "\n",
+ (UV)he->he_valu.hent_refcount );
+ else {
+ (void)PerlIO_putc(file, '\n');
+ do_sv_dump(level+1, file, elt, nest+1, maxnest, dumpops, pvlim);
+ }
}
}
DONEHV:;
--
2.26.3