diff options
author | David Mitchell <davem@iabyn.com> | 2010-07-24 16:11:12 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2010-07-24 16:12:30 +0100 |
commit | 439cdf38ae50bdfe6ca11c86ccc3917d6b56ec45 (patch) | |
tree | 29f14f24747f77842811662534e31bea488d9f5a /gv.c | |
parent | e5c69c9b913b1a7f8a83beabb60e96958df29689 (diff) | |
download | perl-439cdf38ae50bdfe6ca11c86ccc3917d6b56ec45.tar.gz |
small code tweak in Perl_gv_init
(follow-up to previous commit, fix for #76540)
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -296,6 +296,7 @@ Perl_gv_init(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, int multi) /* newCONSTSUB takes ownership of the reference from us. */ cv = newCONSTSUB(stash, (name0 ? name0 : name), has_constant); + assert(GvCV(gv) == cv); /* newCONSTSUB should have set this */ if (name0) Safefree(name0); /* If this reference was a copy of another, then the subroutine @@ -306,8 +307,8 @@ Perl_gv_init(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, int multi) } else { (void) start_subparse(0,0); /* Create empty CV in compcv. */ cv = PL_compcv; + GvCV(gv) = cv; } - GvCV(gv) = cv; LEAVE; mro_method_changed_in(GvSTASH(gv)); /* sub Foo::bar($) { (shift) } sub ASDF::baz($); *ASDF::baz = \&Foo::bar */ |