summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/dump.c b/dump.c
index aa1228b9a7..2a3439aca8 100644
--- a/dump.c
+++ b/dump.c
@@ -2451,10 +2451,9 @@ Perl_do_pmop_xmldump(pTHX_ I32 level, PerlIO *file, const PMOP *pm)
Perl_xmldump_indent(aTHX_ level, file, "<pmop \n");
level++;
if (PM_GETRE(pm)) {
- const char * const s = PM_GETRE(pm)->precomp;
- SV * const tmpsv = newSVpvn("",0);
+ const regexp *const r = PM_GETRE(pm);
+ SV * const tmpsv = newSVpvn(r->precomp,r->prelen);
SvUTF8_on(tmpsv);
- sv_catxmlpvn(tmpsv, s, strlen(s), 1);
Perl_xmldump_indent(aTHX_ level, file, "pre=\"%s\"\n",
SvPVX(tmpsv));
SvREFCNT_dec(tmpsv);