This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Move an assert
authorFather Chrysostomos <sprout@cpan.org>
Sat, 21 May 2011 05:06:35 +0000 (22:06 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 21 May 2011 05:06:35 +0000 (22:06 -0700)
Due to my own sloppy editing, this assert ending up doing nothing,
as perl would already have crashed before reaching it.

gv.c

diff --git a/gv.c b/gv.c
index d22a439..72cc9f6 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -960,6 +960,7 @@ Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen, I32 flags)
        return NULL;
     stash = GvHV(tmpgv);
     if (!(flags & ~GV_NOADD_MASK) && !stash) return NULL;
+    assert(stash);
     if (!HvNAME_get(stash)) {
        hv_name_set(stash, name, namelen, 0);
        
@@ -969,7 +970,6 @@ Perl_gv_stashpvn(pTHX_ const char *name, U32 namelen, I32 flags)
        if (HvAUX(GvSTASH(tmpgv))->xhv_name_count)
            mro_package_moved(stash, NULL, tmpgv, 1);
     }
-    assert(stash);
     return stash;
 }