In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/61084eefd823e097255934e8ab599c0e418e5253?hp=400ffcff649c80c7986e4790a425796a250f2d97>
- Log ----------------------------------------------------------------- commit 61084eefd823e097255934e8ab599c0e418e5253 Author: Craig A. Berry <[email protected]> Date: Sat Aug 5 08:00:32 2017 -0500 Consider magic %ENV as tied in hv_pushkv. For the DYNAMIC_ENV_FETCH case, we don't know the number of keys until the first iteration triggers a call to prime_env_iter(), so piggyback on the tied magic case, which already handles extending the stack for each iteration rather than all at once beforehand. ----------------------------------------------------------------------- Summary of changes: hv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hv.c b/hv.c index 20b4eceb98..7029e28387 100644 --- a/hv.c +++ b/hv.c @@ -988,7 +988,11 @@ void Perl_hv_pushkv(pTHX_ HV *hv, U32 flags) { HE *entry; - bool tied = SvRMAGICAL(hv) && mg_find(MUTABLE_SV(hv), PERL_MAGIC_tied); + bool tied = SvRMAGICAL(hv) && (mg_find(MUTABLE_SV(hv), PERL_MAGIC_tied) +#ifdef DYNAMIC_ENV_FETCH /* might not know number of keys yet */ + || mg_find(MUTABLE_SV(hv), PERL_MAGIC_env) +#endif + ); dSP; PERL_ARGS_ASSERT_HV_PUSHKV; -- Perl5 Master Repository
