From f19a12a3a65a1b840e4df1373a12eab6e50a8d5c Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Mon, 10 Nov 2008 19:13:20 +0000 Subject: Allow lvalue usage of SvRV() and add MUTABLE_SV() check. Also add new SvRV_const() macro for read-only access. p4raw-id: //depot/perl@34804 --- sv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sv.c') diff --git a/sv.c b/sv.c index 436f18fe44..bae7604f66 100644 --- a/sv.c +++ b/sv.c @@ -10562,8 +10562,8 @@ Perl_rvpv_dup(pTHX_ SV *const dstr, const SV *const sstr, CLONE_PARAMS *const pa if (SvROK(sstr)) { SvRV_set(dstr, SvWEAKREF(sstr) - ? sv_dup(SvRV(sstr), param) - : sv_dup_inc(SvRV(sstr), param)); + ? sv_dup(SvRV_const(sstr), param) + : sv_dup_inc(SvRV_const(sstr), param)); } else if (SvPVX_const(sstr)) { -- cgit v1.2.1