summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-01-10 16:24:27 +0000
committerNicholas Clark <nick@ccl4.org>2007-01-10 16:24:27 +0000
commit1df5f7c19502d9913cf1f60730ae040812453f58 (patch)
treeb54e7238a99fe2cac5fe3c57867c9bc0386daf22 /gv.c
parent922adc668bd1a29348ad2aeea3363752c3bab137 (diff)
downloadperl-1df5f7c19502d9913cf1f60730ae040812453f58.tar.gz
An implementation of change 29735 for blead (PL_curcop could be NULL)
given that blead's refactoring is not yet in maint. p4raw-id: //depot/perl@29748
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 9f9b0d34c8..e4c59b5a31 100644
--- a/gv.c
+++ b/gv.c
@@ -161,7 +161,8 @@ GP *
Perl_newGP(pTHX_ GV *const gv)
{
GP *gp;
- const char *const file = CopFILE(PL_curcop) ? CopFILE(PL_curcop) : "";
+ const char *const file
+ = (PL_curcop && CopFILE(PL_curcop)) ? CopFILE(PL_curcop) : "";
STRLEN len = strlen(file);
U32 hash;
@@ -173,7 +174,7 @@ Perl_newGP(pTHX_ GV *const gv)
gp->gv_sv = newSV(0);
#endif
- gp->gp_line = CopLINE(PL_curcop);
+ gp->gp_line = PL_curcop ? CopLINE(PL_curcop) : 0;
/* XXX Ideally this cast would be replaced with a change to const char*
in the struct. */
gp->gp_file_hek = share_hek(file, len, hash);