summaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-09-16 15:48:46 -0700
committerFather Chrysostomos <sprout@cpan.org>2011-09-16 16:03:34 -0700
commit60092ce4854ea5801a4711d82d0e2c57a7edcaca (patch)
treef2244dcfa6ea94be6469ac9496fcb45a01d65021 /pp.c
parenta3342be368647e67883bc6ba3bea07bb06880b80 (diff)
downloadperl-60092ce4854ea5801a4711d82d0e2c57a7edcaca.tar.gz
Make ++ and -- work on glob copies
These ops considered typeglobs read-only, even if they weren’t.
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/pp.c b/pp.c
index 84c68e6359..ba07c31523 100644
--- a/pp.c
+++ b/pp.c
@@ -1054,7 +1054,7 @@ PP(pp_undef)
PP(pp_predec)
{
dVAR; dSP;
- if (SvTYPE(TOPs) >= SVt_PVAV || isGV_with_GP(TOPs))
+ if (SvTYPE(TOPs) >= SVt_PVAV || (isGV_with_GP(TOPs) && !SvFAKE(TOPs)))
Perl_croak_no_modify(aTHX);
if (!SvREADONLY(TOPs) && SvIOK_notUV(TOPs) && !SvNOK(TOPs) && !SvPOK(TOPs)
&& SvIVX(TOPs) != IV_MIN)
@@ -1071,7 +1071,7 @@ PP(pp_predec)
PP(pp_postinc)
{
dVAR; dSP; dTARGET;
- if (SvTYPE(TOPs) >= SVt_PVAV || isGV_with_GP(TOPs))
+ if (SvTYPE(TOPs) >= SVt_PVAV || (isGV_with_GP(TOPs) && !SvFAKE(TOPs)))
Perl_croak_no_modify(aTHX);
if (SvROK(TOPs))
TARG = sv_newmortal();
@@ -1095,7 +1095,7 @@ PP(pp_postinc)
PP(pp_postdec)
{
dVAR; dSP; dTARGET;
- if (SvTYPE(TOPs) >= SVt_PVAV || isGV_with_GP(TOPs))
+ if (SvTYPE(TOPs) >= SVt_PVAV || (isGV_with_GP(TOPs) && !SvFAKE(TOPs)))
Perl_croak_no_modify(aTHX);
if (SvROK(TOPs))
TARG = sv_newmortal();