summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorBen Morrow <ben@morrow.me.uk>2009-01-02 10:41:52 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2009-01-02 10:41:52 +0100
commit8c8eee8276dbc780932b841fe5183943a7117a3d (patch)
treecc172d9b6d0c159858c2471f2b1359c9dc637443 /doop.c
parent50eca76146e11e9c375c0a5c02f5f2102f0911bc (diff)
downloadperl-8c8eee8276dbc780932b841fe5183943a7117a3d.tar.gz
[perl #54956] crash on binary-or lvalue operation on qr//
This fixes the following problem: -e 'my $re = qr/x/; $re |= "y"' assert failure under 5.10.0, 10-maint, bleed, but not 5.8.8
Diffstat (limited to 'doop.c')
-rw-r--r--doop.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/doop.c b/doop.c
index cd9b3b4f17..c08f84e847 100644
--- a/doop.c
+++ b/doop.c
@@ -1231,7 +1231,13 @@ Perl_do_vop(pTHX_ I32 optype, SV *sv, SV *left, SV *right)
if (sv != left || (optype != OP_BIT_AND && !SvOK(sv) && !SvGMAGICAL(sv)))
sv_setpvs(sv, ""); /* avoid undef warning on |= and ^= */
- lsave = lc = SvPV_nomg_const(left, leftlen);
+ if (sv == left) {
+ lsave = lc = SvPV_force_nomg(left, leftlen);
+ }
+ else {
+ lsave = lc = SvPV_nomg_const(left, leftlen);
+ SvPV_force_nomg_nolen(sv);
+ }
rsave = rc = SvPV_nomg_const(right, rightlen);
/* This need to come after SvPV to ensure that string overloading has