refcount held by the target
p4raw-id: //depot/perl@3727
0x00026e04, /* aelemfast */
0x00026404, /* aelem */
0x00046801, /* aslice */
- 0x00009608, /* each */
+ 0x00009600, /* each */
0x00009608, /* values */
0x00009608, /* keys */
0x00003600, /* delete */
# Hashes.
-each each ck_fun t% H
+each each ck_fun % H
values values ck_fun t% H
keys keys ck_fun t% H
delete delete ck_delete % S
PP(pp_each)
{
- djSP; dTARGET;
+ djSP;
HV *hash = (HV*)POPs;
HE *entry;
I32 gimme = GIMME_V;
if (entry) {
PUSHs(hv_iterkeysv(entry)); /* won't clobber stack_sp */
if (gimme == G_ARRAY) {
+ SV *val;
PUTBACK;
/* might clobber stack_sp */
- sv_setsv(TARG, realhv ?
- hv_iterval(hash, entry) : avhv_iterval((AV*)hash, entry));
+ val = realhv ?
+ hv_iterval(hash, entry) : avhv_iterval((AV*)hash, entry);
SPAGAIN;
- PUSHs(TARG);
+ PUSHs(val);
}
}
else if (gimme == G_SCALAR)
#!./perl
-# $RCSfile: each.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:47 $
-
-print "1..16\n";
+print "1..19\n";
$h{'abc'} = 'ABC';
$h{'def'} = 'DEF';
}
}
if ($i == 5) { print "ok 16\n" } else { print "not ok\n" }
+
+{
+ package Obj;
+ sub DESTROY { print "ok 18\n"; }
+ {
+ my $h = { A => bless [], __PACKAGE__ };
+ while (my($k,$v) = each %$h) {
+ print "ok 17\n" if $k eq 'A' and ref($v) eq 'Obj';
+ }
+ }
+ print "ok 19\n";
+}
+