summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-01-17 14:04:06 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-17 14:04:06 +0000
commitcdec4f4964dcec2d0a196d0906e4ec5a387041bf (patch)
treedf714a64abfb86788d1f2cdaab59959fffe21e64 /scope.c
parent18880e27741f3630c8397e7af71f1f442ce62022 (diff)
downloadperl-cdec4f4964dcec2d0a196d0906e4ec5a387041bf.tar.gz
Retract #14144 as Hugo isn't happy with it.
p4raw-id: //depot/perl@14307
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/scope.c b/scope.c
index 59adddf66f..3303011393 100644
--- a/scope.c
+++ b/scope.c
@@ -693,7 +693,9 @@ Perl_leave_scope(pTHX_ I32 base)
DEBUG_S(PerlIO_printf(Perl_debug_log,
"restore svref: %p %p:%s -> %p:%s\n",
ptr, sv, SvPEEK(sv), value, SvPEEK(value)));
- if (SvTYPE(sv) == SVt_PVMG && SvMAGIC(sv)) {
+ if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv) &&
+ SvTYPE(sv) != SVt_PVGV)
+ {
(void)SvUPGRADE(value, SvTYPE(sv));
SvMAGIC(value) = SvMAGIC(sv);
SvFLAGS(value) |= SvMAGICAL(sv);
@@ -705,7 +707,9 @@ Perl_leave_scope(pTHX_ I32 base)
* croaking that might ensue when the SvSETMAGIC() below is
* called, or to avoid two different SVs pointing at the same
* SvMAGIC()). This needs a total rethink. --GSAR */
- else if (SvTYPE(value) == SVt_PVMG && SvMAGIC(value)) {
+ else if (SvTYPE(value) >= SVt_PVMG && SvMAGIC(value) &&
+ SvTYPE(value) != SVt_PVGV)
+ {
SvFLAGS(value) |= (SvFLAGS(value) &
(SVp_NOK|SVp_POK)) >> PRIVSHIFT;
SvMAGICAL_off(value);