diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-24 14:19:37 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-24 14:19:37 +0000 |
commit | 2892acdbbc776bf121eaec9d93ea404f7afc54b8 (patch) | |
tree | c3fbfb10ffb7ab31100f465f4c0fa6745c5f069f /pad.c | |
parent | e736a858356e87659136ef1f34af858e253efe45 (diff) | |
download | perl-2892acdbbc776bf121eaec9d93ea404f7afc54b8.tar.gz |
Use PVMGs rather than PVGVs to store the names of our variables in the
pad.
p4raw-id: //depot/perl@27313
Diffstat (limited to 'pad.c')
-rw-r--r-- | pad.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -74,10 +74,10 @@ in PL_op->op_targ), wasting a name SV for them doesn't make sense. The SVs in the names AV have their PV being the name of the variable. NV+1..IV inclusive is a range of cop_seq numbers for which the name is valid. For typed lexicals name SV is SVt_PVMG and SvSTASH points at the -type. For C<our> lexicals, the type is SVt_PVGV, and GvSTASH points at the -stash of the associated global (so that duplicate C<our> declarations in the -same package can be detected). SvCUR is sometimes hijacked to -store the generation number during compilation. +type. For C<our> lexicals, the type is also SVt_PVGV, with the MAGIC slot +pointing at the stash of the associated global (so that duplicate C<our> +declarations in the same package can be detected). SvCUR is sometimes +hijacked to store the generation number during compilation. If SvFAKE is set on the name SV, then that slot in the frame AV is a REFCNT'ed reference to a lexical from "outside". In this case, @@ -338,7 +338,7 @@ Perl_pad_add_name(pTHX_ const char *name, HV* typestash, HV* ourstash, bool fake ASSERT_CURPAD_ACTIVE("pad_add_name"); - sv_upgrade(namesv, ourstash ? SVt_PVGV : typestash ? SVt_PVMG : SVt_PVNV); + sv_upgrade(namesv, (ourstash || typestash) ? SVt_PVMG : SVt_PVNV); sv_setpv(namesv, name); if (typestash) { |