given that blead's refactoring is not yet in maint.
p4raw-id: //depot/perl@29748
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;
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);