summaryrefslogtreecommitdiff
path: root/doop.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-12-28 22:38:00 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-12-28 22:38:52 -0800
commit2b32fed87e17d7b5d5ecf7d79a2f7cfd1dfd5d26 (patch)
treee4eea79d0a87e46d0ba9ab1a96378c5ab038dec0 /doop.c
parent3cb4e04f6580a268b63eec5535af8d7455697971 (diff)
downloadperl-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.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/doop.c b/doop.c
index 62edb06297..3ed63f6612 100644
--- a/doop.c
+++ b/doop.c
@@ -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;
}
/*