From f5d98eaa982e26fadd6e4173f4515f6c2126566f Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Sat, 10 Aug 2013 11:55:11 -0700 Subject: [PATCH] gv.c:newGP: assert that PL_curcop is not NULL It should never be null here, and we want to know if it is. (It can be set to null in op.c:S_cop_free, but it should always have been set to something else by the time newGP is called.) Nevertheless, we should leave the null checks in place, to avoid sabo- taging non-debugging builds if there are any remaining bugs here. --- gv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gv.c b/gv.c index f51f782..13bcbbf 100644 --- a/gv.c +++ b/gv.c @@ -176,6 +176,9 @@ Perl_newGP(pTHX_ GV *const gv) gp->gp_sv = newSV(0); #endif + /* PL_curcop should never be null here. */ + assert(PL_curcop); + /* But for non-debugging builds play it safe */ if (PL_curcop) { gp->gp_line = CopLINE(PL_curcop); /* 0 otherwise Newxz */ #ifdef USE_ITHREADS -- 2.7.4