From: Nicholas Clark Date: Sun, 6 Jan 2008 13:04:51 +0000 (+0000) Subject: Fix a bug in mad - regexps can be 8 bit, not just ASCII or UTF-8. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ecd6c0a032c3e1cfa14b0a916a8f69fdefe81a97;p=p5sagit%2Fp5-mst-13.2.git Fix a bug in mad - regexps can be 8 bit, not just ASCII or UTF-8. p4raw-id: //depot/perl@32866 --- diff --git a/dump.c b/dump.c index d397616..3e4db86 100644 --- a/dump.c +++ b/dump.c @@ -2468,9 +2468,8 @@ Perl_do_pmop_xmldump(pTHX_ I32 level, PerlIO *file, const PMOP *pm) level++; if (PM_GETRE(pm)) { REGEXP *const r = PM_GETRE(pm); - /* FIXME ORANGE - REGEXP can be 8 bit, so this is sometimes buggy: */ - SV * const tmpsv = newSVpvn(RX_PRECOMP(r),RX_PRELEN(r)); - SvUTF8_on(tmpsv); + SV * const tmpsv = newSVsv((SV*)r); + sv_utf8_upgrade(tmpsv); Perl_xmldump_indent(aTHX_ level, file, "pre=\"%s\"\n", SvPVX(tmpsv)); SvREFCNT_dec(tmpsv);