develooper Front page | perl.perl5.porters | Postings from December 2008

Re: 5.10.0 regressions that need fixing

Thread Previous | Thread Next
From:
Ben Morrow
Date:
December 29, 2008 18:46
Subject:
Re: 5.10.0 regressions that need fixing
Message ID:
u6eo26-foj2.ln1@osiris.mauzo.dyndns.org

Quoth davem@iabyn.com (Dave Mitchell):
> 
> Subject: [perl #54956] crash on binary-or lvalue operation on qr//
> 
>     -e 'my $re = qr/x/; $re |= "y"'
>     assert failure under 5.10.0, 10-maint, bleed, but not 5.8.8

I *believe* the correct fix for this is

diff --git a/doop.c b/doop.c
index cd9b3b4..0cb82a5 100644
--- a/doop.c
+++ b/doop.c
@@ -1233,6 +1233,7 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
 	sv_setpvs(sv, "");	/* avoid undef warning on |= and ^= */
     lsave = lc = SvPV_nomg_const(left, leftlen);
     rsave = rc = SvPV_nomg_const(right, rightlen);
+    SvPV_force_nomg_nolen(sv);
 
     /* This need to come after SvPV to ensure that string overloading has
        fired off.  */

but it's hard to be sure this won't have side-effects (I don't really
understand the details of how magic/overloading/stringification/etc.
interact). I'll see if I can find time to come up with some decent test
cases.

Ben


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About