diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-05-02 11:15:26 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-05-02 11:15:26 +0000 |
commit | 128165928a7fa68e9b3adbdf3695141c97adb115 (patch) | |
tree | 686772b21c9493c5f8310f18565ee0a60050fd49 /scope.c | |
parent | 9b38b30791d5c3d84f35037508a73dd07542022f (diff) | |
download | perl-128165928a7fa68e9b3adbdf3695141c97adb115.tar.gz |
De-duplicate the code that creates new GPs into Perl_newGP().
p4raw-id: //depot/perl@28058
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -267,9 +267,7 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty) SSPUSHINT(SAVEt_GP); if (empty) { - register GP *gp; - - Newxz(gp, 1, GP); + GP *gp = Perl_newGP(aTHX_ gv); if (GvCVu(gv)) PL_sub_generation++; /* taking a method out of circulation */ @@ -277,15 +275,7 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty) gp->gp_io = newIO(); IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START; } - GvGP(gv) = gp_ref(gp); -#ifndef PERL_DONT_CREATE_GVSV - GvSV(gv) = newSV(0); -#endif - GvLINE(gv) = CopLINE(PL_curcop); - /* XXX Ideally this cast would be replaced with a change to const char* - in the struct. */ - GvFILE(gv) = CopFILE(PL_curcop) ? CopFILE(PL_curcop) : (char *) ""; - GvEGV(gv) = gv; + GvGP(gv) = gp; } else { gp_ref(GvGP(gv)); |