diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-05-31 08:25:57 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-05-31 08:25:57 +0000 |
commit | 726514722fdec00cc69b3e5c86392c5c95a01f07 (patch) | |
tree | 09eb22fbf479bbf221037570c41c5a3e04118974 /scope.c | |
parent | 2c7f4b87d1721d033cf5fc3b5a553f25a8d8485f (diff) | |
download | perl-726514722fdec00cc69b3e5c86392c5c95a01f07.tar.gz |
blead segfaults on local *@; eval {1} because ERRSV assumes that
GvSV(PL_errgv) is always non-NULL. That stopped being the case with
change 25009 (ish) - when we stopped automatically creating a(n unused)
SV at GV creation time.
p4raw-id: //depot/perl@31313
Diffstat (limited to 'scope.c')
-rw-r--r-- | scope.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -261,6 +261,14 @@ Perl_save_gp(pTHX_ GV *gv, I32 empty) gp->gp_io = newIO(); IoFLAGS(gp->gp_io) |= IOf_ARGV|IOf_START; } +#ifdef PERL_DONT_CREATE_GVSV + if (gv == PL_errgv) { + /* We could scatter this logic everywhere by changing the + definition of ERRSV from GvSV() to GvSVn(), but it seems more + efficient to do this check once here. */ + gp->gp_sv = newSV(0); + } +#endif GvGP(gv) = gp; } else { |