diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-12-28 22:38:00 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-12-28 22:38:52 -0800 |
commit | 2b32fed87e17d7b5d5ecf7d79a2f7cfd1dfd5d26 (patch) | |
tree | e4eea79d0a87e46d0ba9ab1a96378c5ab038dec0 /doop.c | |
parent | 3cb4e04f6580a268b63eec5535af8d7455697971 (diff) | |
download | perl-2b32fed87e17d7b5d5ecf7d79a2f7cfd1dfd5d26.tar.gz |
Remove PUTBACK/SPAGAIN from hash iter ops
These were added by perl-5a2-2-g463ee0b and perl-5.003-2-gc750a3e. At
the time, hv_iternext and hv_iterval could reallocate the stack, but
hv_iterkey was safe. perl-5.6.0-8537-g574c802 divorced the comments
about hv_iterkey from the lines containing hv_iterkey, making things a
bit confusing. Somewhere along the road, all tied hash functionality
started being guarded with PUSHSTACK, so these hash functions won’t
reallocate the stack any more.
Diffstat (limited to 'doop.c')
-rw-r--r-- | doop.c | 9 |
1 files changed, 2 insertions, 7 deletions
@@ -1269,27 +1269,22 @@ Perl_do_kv(pTHX) EXTEND(SP, HvUSEDKEYS(keys) * (dokeys + dovalues)); - PUTBACK; /* hv_iternext and hv_iterval might clobber stack_sp */ while ((entry = hv_iternext(keys))) { - SPAGAIN; if (dokeys) { SV* const sv = hv_iterkeysv(entry); - XPUSHs(sv); /* won't clobber stack_sp */ + XPUSHs(sv); } if (dovalues) { SV *tmpstr; - PUTBACK; tmpstr = hv_iterval(keys,entry); DEBUG_H(Perl_sv_setpvf(aTHX_ tmpstr, "%lu%%%d=%lu", (unsigned long)HeHASH(entry), (int)HvMAX(keys)+1, (unsigned long)(HeHASH(entry) & HvMAX(keys)))); - SPAGAIN; XPUSHs(tmpstr); } - PUTBACK; } - return NORMAL; + RETURN; } /* |