This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
assert(cv) before doing CvROOT(cv)
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 6 Feb 2016 23:54:29 +0000 (18:54 -0500)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 7 Feb 2016 13:23:46 +0000 (08:23 -0500)
Coverity CID 29020 (an old one from 2014, wondering why it now resurfaced)

pp_hot.c

index 18f4962..6a280ab 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -3780,6 +3780,7 @@ PP(pp_entersub)
 
     /* these two fields are in a union. If they ever become separate,
      * we have to test for both of them being null below */
+    assert(cv);
     assert((void*)&CvROOT(cv) == (void*)&CvXSUB(cv));
     while (UNLIKELY(!CvROOT(cv))) {
        GV* autogv;