summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-08-10 10:46:43 -0700
committerFather Chrysostomos <sprout@cpan.org>2013-08-11 10:53:35 -0700
commitcb0d3385a7bb30bc0aaa2ada8f6f21fe3554ec32 (patch)
treee640e85f8997654f0f4165410c0e620becd79169 /gv.c
parent515abc43ad7e359e9f2f1fedb73378c13fd16348 (diff)
downloadperl-cb0d3385a7bb30bc0aaa2ada8f6f21fe3554ec32.tar.gz
Restore NULL check to gv.c:newGP, removed by 19bad673
1df5f7c195 added checks to newGP to account for PL_curcop being NULL. 19bad673 inadvertently removed the NULL check for non-threaded builds, except in one spot. Since S_cop_free now sets PL_curcop to NULL as of the previous commit (something 1df5f7c195 was meant to do but didn’t), this check is a good idea, even though PL_curcop is never NULL here. See also <20130805200313.GS3729@plum.flirble.org>.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/gv.c b/gv.c
index 869d237660..076fafd76e 100644
--- a/gv.c
+++ b/gv.c
@@ -191,13 +191,17 @@ Perl_newGP(pTHX_ GV *const gv)
len = 0;
}
#else
- if(PL_curcop)
+ if(PL_curcop) {
gp->gp_line = CopLINE(PL_curcop); /* 0 otherwise Newxz */
- filegv = CopFILEGV(PL_curcop);
- if (filegv) {
- file = GvNAME(filegv)+2;
- len = GvNAMELEN(filegv)-2;
- } else {
+ filegv = CopFILEGV(PL_curcop);
+ if (filegv) {
+ file = GvNAME(filegv)+2;
+ len = GvNAMELEN(filegv)-2;
+ }
+ else goto no_file;
+ }
+ else {
+ no_file:
file = "";
len = 0;
}