diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-11-16 16:29:27 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-16 17:48:25 -0800 |
commit | 0290c7107ccd726700dd863729fdba3207051905 (patch) | |
tree | 2a900a2238252adde2ed5c7fa6ad9626a3f9f205 /mro.c | |
parent | c2736fce83b2520da4fdb4759d0c6cd91860d6de (diff) | |
download | perl-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.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 :: */ } |