X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=scope.c;h=d0646bc248252e3507c7532e5aa34cfcc92752e9;hb=0dbd57a10c8cc972ad52305885705b0194739bca;hp=59adddf66f76fc410af662556fa621f98f8d81a2;hpb=05ec9bb346c404c8906ed1ac374d4bce61c84f5d;p=p5sagit%2Fp5-mst-13.2.git diff --git a/scope.c b/scope.c index 59adddf..d0646bc 100644 --- a/scope.c +++ b/scope.c @@ -1,6 +1,6 @@ /* scope.c * - * Copyright (c) 1991-2001, Larry Wall + * Copyright (c) 1991-2002, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -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);