summaryrefslogtreecommitdiff
path: root/mro.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2010-11-16 16:29:27 -0800
committerFather Chrysostomos <sprout@cpan.org>2010-11-16 17:48:25 -0800
commit0290c7107ccd726700dd863729fdba3207051905 (patch)
tree2a900a2238252adde2ed5c7fa6ad9626a3f9f205 /mro.c
parentc2736fce83b2520da4fdb4759d0c6cd91860d6de (diff)
downloadperl-0290c7107ccd726700dd863729fdba3207051905.tar.gz
Don’t skip mro_package_moved if the parent stash is renamed
This stops S_hv_delete_common from skipping the call to mro_package_moved if the HvNAME of the stash containing the deleted glob is no longer valid, but the stash is still attached to some other part of the symbol table.
Diffstat (limited to 'mro.c')
-rw-r--r--mro.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/mro.c b/mro.c
index 1aac22585c..9083d56f23 100644
--- a/mro.c
+++ b/mro.c
@@ -693,6 +693,10 @@ non-existent packages that have corresponding entries in C<stash>.
It also sets the effective names (C<HvENAME>) on all the stashes as
appropriate.
+If the C<gv> is present and is not in the symbol table, then this function
+simply returns. This checked will be skipped if C<newname_len> is set to 1
+and C<newname> is null.
+
=cut
*/
void
@@ -721,13 +725,15 @@ Perl_mro_package_moved(pTHX_ HV * const stash, HV * const oldstash,
*
* If newname is not null, then we trust that the caller gave us the
* right name. Otherwise, we get it from the gv. But if the gv is not
- * in the symbol table, then we just return.
+ * in the symbol table, then we just return. We skip that check,
+ * however, if newname_len is 1 and newname is null.
*/
if(!newname && gv) {
SV * const namesv = sv_newmortal();
STRLEN len;
gv_fullname4(namesv, gv, NULL, 0);
- if(gv_fetchsv(namesv, GV_NOADD_NOINIT, SVt_PVGV) != gv) return;
+ if( newname_len != 1
+ && gv_fetchsv(namesv, GV_NOADD_NOINIT, SVt_PVGV) != gv ) return;
newname = SvPV_const(namesv, len);
newname_len = len - 2; /* skip trailing :: */
}