In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/5b2ef88ec2b538ad872eb354160909d8bd529aa7?hp=e167a7177da799ca1757dc382b386abd3ae29491>
- Log ----------------------------------------------------------------- commit 5b2ef88ec2b538ad872eb354160909d8bd529aa7 Author: James E Keenan <jkee...@cpan.org> Date: Thu Aug 4 18:47:15 2016 -0400 Revert "gv.c:require_tie_mod: Create namesv only when needed" This reverts commit e167a7177da799ca1757dc382b386abd3ae29491. Observed to cause many test failures on Linux and FreeBSD. See message on list with subject "Many test failures in blead". ----------------------------------------------------------------------- Summary of changes: gv.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gv.c b/gv.c index 1e2f515..0fd789d 100644 --- a/gv.c +++ b/gv.c @@ -1312,6 +1312,7 @@ S_require_tie_mod(pTHX_ GV *gv, const char *varpv, const char * name, load_module, so save it. For the moment itâs always a single char. */ const SV * const target = varname == '[' ? GvSV(gv) : (SV *)GvHV(gv); + SV * const namesv = newSVpvn(name, len); PERL_ARGS_ASSERT_REQUIRE_TIE_MOD; @@ -1325,20 +1326,19 @@ S_require_tie_mod(pTHX_ GV *gv, const char *varpv, const char * name, dSP; ENTER; + SAVEFREESV(namesv); #define HV_FETCH_TIE_FUNC (GV **)hv_fetch(stash, "_tie_it", 7, 0) /* Load the module if it is not loaded. */ - if (!(stash = gv_stashpvn(name, len, 0)) + if (!(stash = gv_stashsv(namesv, 0)) || !(gvp = HV_FETCH_TIE_FUNC) || !*gvp || !GvCV(*gvp)) { - SV * const namesv = newSVpvn(name, len); + SV *module = newSVsv(namesv); const char type = varname == '[' ? '$' : '%'; - SAVEFREESV(namesv); if ( flags & 1 ) save_scalar(gv); - Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, - SvREFCNT_inc_NN(namesv), NULL); + Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT, module, NULL); assert(sp == PL_stack_sp); stash = gv_stashsv(namesv, 0); if (!stash) @@ -1356,6 +1356,7 @@ S_require_tie_mod(pTHX_ GV *gv, const char *varpv, const char * name, call_sv((SV *)*gvp, G_VOID|G_DISCARD); LEAVE; } + else SvREFCNT_dec_NN(namesv); } /* -- Perl5 Master Repository