diff options
author | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2008-11-07 22:33:39 +0000 |
---|---|---|
committer | Marcus Holland-Moritz <mhx-perl@gmx.net> | 2008-11-07 22:33:39 +0000 |
commit | d2c6dc5ee586de7e57a1fe8c160cf7c8aaf3f3f8 (patch) | |
tree | a327fc3bbaaeba3b7d394962e7685591b50033be /sv.c | |
parent | da7fcca4b8d6fb4dc88e0305bf9830bf24912ebd (diff) | |
download | perl-d2c6dc5ee586de7e57a1fe8c160cf7c8aaf3f3f8.tar.gz |
Revert SvPVX() to allow lvalue usage, but also add a
MUTABLE_SV() check. Use SvPVX_const() instead of SvPVX()
where only a const SV* is available. Also fix two falsely
consted pointers in Perl_sv_2pv_flags().
p4raw-id: //depot/perl@34770
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2840,13 +2840,13 @@ Perl_sv_2pv_flags(pTHX_ register SV *const sv, STRLEN *const lp, const I32 flags STRLEN len; char *retval; char *buffer; - const SV *const referent = SvRV(sv); + SV *const referent = SvRV(sv); if (!referent) { len = 7; retval = buffer = savepvn("NULLREF", len); } else if (SvTYPE(referent) == SVt_REGEXP) { - const REGEXP * const re = (REGEXP *)referent; + REGEXP * const re = (REGEXP *)MUTABLE_PTR(referent); I32 seen_evals = 0; assert(re); @@ -10567,7 +10567,7 @@ Perl_rvpv_dup(pTHX_ SV *const dstr, const SV *const sstr, CLONE_PARAMS *const pa } else { /* Some other special case - random pointer */ - SvPV_set(dstr, SvPVX(sstr)); + SvPV_set(dstr, (char *) SvPVX_const(sstr)); } } } |