summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2007-03-21 11:39:24 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2007-03-22 09:01:37 +0000
commit28d8d7f41ab202dd5f7611033d27ecad44cadd60 (patch)
tree330e1fcd2c3e0573355f25c14fc04ce0e64c608c /dump.c
parentda140a4068f95cc339e9327c1579a94f9f241dd8 (diff)
downloadperl-28d8d7f41ab202dd5f7611033d27ecad44cadd60.tar.gz
Resolve PL_curpm issues with (??{}) and fix corruption of match results when pattern is a qr.
Message-ID: <9b18b3110703210239x540f5ad9mdb41c2ea6229ac31@mail.gmail.com> plus two follow-up patches (minor tweaks) p4raw-id: //depot/perl@30678
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/dump.c b/dump.c
index 3bfdeeb3f6..e9fa1ae83d 100644
--- a/dump.c
+++ b/dump.c
@@ -1263,8 +1263,20 @@ Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, const MAGIC *mg, I32 nest, I32
Perl_dump_indent(aTHX_ level, file, " MINMATCH\n");
}
if (mg->mg_obj) {
- Perl_dump_indent(aTHX_ level, file, " MG_OBJ = 0x%"UVxf"\n", PTR2UV(mg->mg_obj));
- if (mg->mg_flags & MGf_REFCOUNTED)
+ Perl_dump_indent(aTHX_ level, file, " MG_OBJ = 0x%"UVxf"\n",
+ PTR2UV(mg->mg_obj));
+ if (mg->mg_type == PERL_MAGIC_qr) {
+ regexp *re=(regexp *)mg->mg_obj;
+ SV *dsv= sv_newmortal();
+ const char * const s = pv_pretty(dsv, re->wrapped, re->wraplen,
+ 60, NULL, NULL,
+ ( PERL_PV_PRETTY_QUOTE | PERL_PV_ESCAPE_RE | PERL_PV_PRETTY_ELIPSES |
+ ((re->extflags & RXf_UTF8) ? PERL_PV_ESCAPE_UNI : 0))
+ );
+ Perl_dump_indent(aTHX_ level+1, file, " PAT = %s\n", s);
+ Perl_dump_indent(aTHX_ level+1, file, " REFCNT = %"IVdf"\n", (IV*)re->refcnt);
+ }
+ if (mg->mg_flags & MGf_REFCOUNTED)
do_sv_dump(level+2, file, mg->mg_obj, nest+1, maxnest, dumpops, pvlim); /* MG is already +1 */
}
if (mg->mg_len)