summaryrefslogtreecommitdiff
path: root/mro.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-10-30 14:27:48 -0700
committerFather Chrysostomos <sprout@cpan.org>2010-10-30 14:28:22 -0700
commitd7fbb1de45aa77d305eccd94d8c07d7a1491fc45 (patch)
treec3ca64e54d5db7ccd4fc61a05932f841e1e9515c /mro.c
parent435e8dd0d80d4d354981c5cf9051cdea58fcf07e (diff)
downloadperl-d7fbb1de45aa77d305eccd94d8c07d7a1491fc45.tar.gz
Set stash names before calling mro_isa_changed_in3
mro_isa_changed_in3 cannot update isa caches properly if it only sees an intermediate state.
Diffstat (limited to 'mro.c')
-rw-r--r--mro.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/mro.c b/mro.c
index ac2dea26cd..9e433d41c7 100644
--- a/mro.c
+++ b/mro.c
@@ -662,11 +662,19 @@ Perl_mro_package_moved(pTHX_ HV * const stash, HV * const oldstash,
}
if(newname_len < 0) newname_len = -newname_len;
+ if(oldstash && HvENAME_get(oldstash)) {
+ if(PL_stashcache)
+ (void)
+ hv_delete(PL_stashcache, newname, newname_len, G_DISCARD);
+ hv_ename_delete(oldstash, newname, newname_len);
+ }
+ if(stash) hv_ename_add(stash, newname, newname_len);
+
mro_isa_changed_in3((HV *)oldstash, newname, newname_len);
if(
(!stash || !HvARRAY(stash)) && (!oldstash || !HvARRAY(oldstash))
- ) goto set_names;
+ ) return;
/* This is partly based on code in hv_iternext_flags. We are not call-
ing that here, as we want to avoid resetting the hash iterator. */
@@ -810,15 +818,6 @@ Perl_mro_package_moved(pTHX_ HV * const stash, HV * const oldstash,
}
}
}
-
- set_names:
- if(oldstash && HvENAME_get(oldstash)) {
- if(PL_stashcache)
- (void)
- hv_delete(PL_stashcache, newname, newname_len, G_DISCARD);
- hv_ename_delete(oldstash, newname, newname_len);
- }
- if(stash) hv_ename_add(stash, newname, newname_len);
}
/*