diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-15 23:54:38 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-15 23:54:38 +0000 |
commit | 3d93dc8b63d7edad21db9be58a13ec9ba6004930 (patch) | |
tree | bf06dc05f4dfaf900648dcb5bfd86507ce094eba /op.c | |
parent | acb746053d23ffdeb058c98e7148ae317e2c9b9d (diff) | |
download | perl-3d93dc8b63d7edad21db9be58a13ec9ba6004930.tar.gz |
propagate typeness of lexicals while cloning them
p4raw-id: //depot/perl@1975
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -219,6 +219,12 @@ pad_findlex(char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix, I32 s SvNVX(namesv) = (double)PL_curcop->cop_seq; SvIVX(namesv) = PAD_MAX; /* A ref, intro immediately */ SvFAKE_on(namesv); /* A ref, not a real var */ + if (SvOBJECT(svp[off])) { /* A typed var */ + SvOBJECT_on(namesv); + (void)SvUPGRADE(namesv, SVt_PVMG); + SvSTASH(namesv) = (HV*)SvREFCNT_inc((SV*)SvSTASH(svp[off])); + PL_sv_objcount++; + } if (CvANON(PL_compcv) || SvTYPE(PL_compcv) == SVt_PVFM) { /* "It's closures all the way down." */ CvCLONE_on(PL_compcv); |