diff options
author | David Mitchell <davem@iabyn.com> | 2017-08-04 14:00:26 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-08-04 14:10:20 +0100 |
commit | 89042fa4090fc5634ff775e753c58b0827ad6af8 (patch) | |
tree | f5bcd4768e671a937ee8e3584166db37c45479e9 /dump.c | |
parent | 89699a04a6346cff31d7d8cdd6e39556b846dcf6 (diff) | |
download | perl-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.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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 |