diff options
author | Craig A. Berry <craigberry@mac.com> | 2017-08-05 08:00:32 -0500 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2017-08-05 08:00:32 -0500 |
commit | 61084eefd823e097255934e8ab599c0e418e5253 (patch) | |
tree | 9047dd9507be896648efbeaeba1de5a649d396a5 /hv.c | |
parent | 400ffcff649c80c7986e4790a425796a250f2d97 (diff) | |
download | perl-61084eefd823e097255934e8ab599c0e418e5253.tar.gz |
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.
Diffstat (limited to 'hv.c')
-rw-r--r-- | hv.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |