summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-08-04 14:00:26 +0100
committerDavid Mitchell <davem@iabyn.com>2017-08-04 14:10:20 +0100
commit89042fa4090fc5634ff775e753c58b0827ad6af8 (patch)
treef5bcd4768e671a937ee8e3584166db37c45479e9 /dump.c
parent89699a04a6346cff31d7d8cdd6e39556b846dcf6 (diff)
downloadperl-89042fa4090fc5634ff775e753c58b0827ad6af8.tar.gz
sv_dump(): display regex LEN and LV-as-RX regexp
When the len field of a REGEXP isn't usurped, display it (it used to always be skipped for REGEXPs). When it's usurped by a PVLV to point to a 'struct regexp', display it as a pointer.
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/dump.c b/dump.c
index fa5f0baf91..1fa242204e 100644
--- a/dump.c
+++ b/dump.c
@@ -1836,7 +1836,12 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
PerlIO_printf(file, "\n");
}
Perl_dump_indent(aTHX_ level, file, " CUR = %" IVdf "\n", (IV)SvCUR(sv));
- if (!re)
+ if (re && type == SVt_PVLV)
+ /* LV-as-REGEXP usurps len field to store poiunter to
+ * regexp struct */
+ Perl_dump_indent(aTHX_ level, file, " REGEXP = 0x%" UVxf "\n",
+ PTR2UV(((XPV*)SvANY(sv))->xpv_len_u.xpvlenu_rx));
+ else
Perl_dump_indent(aTHX_ level, file, " LEN = %" IVdf "\n",
(IV)SvLEN(sv));
#ifdef PERL_COPY_ON_WRITE