summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2010-07-24 16:11:12 +0100
committerDavid Mitchell <davem@iabyn.com>2010-07-24 16:12:30 +0100
commit439cdf38ae50bdfe6ca11c86ccc3917d6b56ec45 (patch)
tree29f14f24747f77842811662534e31bea488d9f5a /gv.c
parente5c69c9b913b1a7f8a83beabb60e96958df29689 (diff)
downloadperl-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gv.c b/gv.c
index a50878f549..6f63f4bd8f 100644
--- a/gv.c
+++ b/gv.c
@@ -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 */