summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dump.c b/dump.c
index 7ad09b1e0c..37337bbabe 100644
--- a/dump.c
+++ b/dump.c
@@ -2534,8 +2534,8 @@ Perl_do_pmop_xmldump(pTHX_ I32 level, PerlIO *file, const PMOP *pm)
level++;
if (PM_GETRE(pm)) {
REGEXP *const r = PM_GETRE(pm);
- SV * const tmpsv = newSVsv((SV*)r);
- sv_utf8_upgrade(tmpsv);
+ SV * const tmpsv = newSVpvn_utf8("", 0, TRUE);
+ sv_catxmlsv(tmpsv, (SV*)r);
Perl_xmldump_indent(aTHX_ level, file, "pre=\"%s\"\n",
SvPVX(tmpsv));
SvREFCNT_dec(tmpsv);