summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorMarcus Holland-Moritz <mhx-perl@gmx.net>2008-11-07 22:33:39 +0000
committerMarcus Holland-Moritz <mhx-perl@gmx.net>2008-11-07 22:33:39 +0000
commitd2c6dc5ee586de7e57a1fe8c160cf7c8aaf3f3f8 (patch)
treea327fc3bbaaeba3b7d394962e7685591b50033be /sv.h
parentda7fcca4b8d6fb4dc88e0305bf9830bf24912ebd (diff)
downloadperl-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.h')
-rw-r--r--sv.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sv.h b/sv.h
index 2722083b78..3717070445 100644
--- a/sv.h
+++ b/sv.h
@@ -1072,7 +1072,7 @@ the scalar's value cannot change unless written to.
# if defined (DEBUGGING) && defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
/* These get expanded inside other macros that already use a variable _sv */
# define SvPVX(sv) \
- (*({ const SV *const _svpvx = (const SV *)(sv); \
+ (*({ SV *const _svpvx = MUTABLE_SV(sv); \
assert(SvTYPE(_svpvx) >= SVt_PV); \
assert(SvTYPE(_svpvx) != SVt_PVAV); \
assert(SvTYPE(_svpvx) != SVt_PVHV); \