diff options
author | Father Chrysostomos <sprout@cpan.org> | 2013-08-10 11:55:11 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-08-11 10:53:35 -0700 |
commit | f5d98eaa982e26fadd6e4173f4515f6c2126566f (patch) | |
tree | 93456cc3384063493b8d2a77624e1c99226dd1b7 /gv.c | |
parent | 6e314d4f049a1b94d19f8b45006741632f2175a7 (diff) | |
download | perl-f5d98eaa982e26fadd6e4173f4515f6c2126566f.tar.gz |
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.
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 |