diff options
author | Ben Morrow <ben@morrow.me.uk> | 2009-01-02 10:41:52 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@gmail.com> | 2009-01-02 10:41:52 +0100 |
commit | 8c8eee8276dbc780932b841fe5183943a7117a3d (patch) | |
tree | cc172d9b6d0c159858c2471f2b1359c9dc637443 /doop.c | |
parent | 50eca76146e11e9c375c0a5c02f5f2102f0911bc (diff) | |
download | perl-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.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 |