summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-05-31 08:25:57 +0000
committerNicholas Clark <nick@ccl4.org>2007-05-31 08:25:57 +0000
commit726514722fdec00cc69b3e5c86392c5c95a01f07 (patch)
tree09eb22fbf479bbf221037570c41c5a3e04118974 /scope.c
parent2c7f4b87d1721d033cf5fc3b5a553f25a8d8485f (diff)
downloadperl-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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index 964a3b92e8..c9700b372f 100644
--- a/scope.c
+++ b/scope.c
@@ -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 {