Change 18258 by jhi@lyta on 2002/12/08 15:24:00
Retract #18252 and #18256.
Affected files ...
.... //depot/maint-5.8/perl/hv.c#3 edit
.... //depot/maint-5.8/perl/lib/Hash/Util.t#3 edit
.... //depot/maint-5.8/perl/regcomp.c#6 edit
.... //depot/maint-5.8/perl/t/op/lc.t#4 edit
Differences ...
==== //depot/maint-5.8/perl/hv.c#3 (text) ====
Index: perl/hv.c
--- perl/hv.c#2~18256~ Sat Dec 7 10:24:27 2002
+++ perl/hv.c Sun Dec 8 07:24:00 2002
@@ -1845,7 +1845,6 @@
Newz(506, xhv->xhv_array /* HvARRAY(hv) */,
PERL_HV_ARRAY_ALLOC_BYTES(xhv->xhv_max+1 /* HvMAX(hv)+1 */),
char);
- /* At start of hash, entry is NULL. */
if (entry)
{
entry = HeNEXT(entry);
@@ -1860,11 +1859,8 @@
}
}
while (!entry) {
- /* OK. Come to the end of the current list. Grab the next one. */
-
xhv->xhv_riter++; /* HvRITER(hv)++ */
if (xhv->xhv_riter > (I32)xhv->xhv_max /* HvRITER(hv) > HvMAX(hv) */) {
- /* There is no next one. End of the hash. */
xhv->xhv_riter = -1; /* HvRITER(hv) = -1 */
break;
}
@@ -1872,14 +1868,10 @@
entry = ((HE**)xhv->xhv_array)[xhv->xhv_riter];
if (!(flags & HV_ITERNEXT_WANTPLACEHOLDERS)) {
- /* If we have an entry, but it's a placeholder, don't count it.
- Try the next. */
- while (entry && HeVAL(entry) == &PL_sv_undef)
- entry = HeNEXT(entry);
- }
- /* Will loop again if this linked list starts NULL
- (for HV_ITERNEXT_WANTPLACEHOLDERS)
- or if we run through it and find only placeholders. */
+ /* if we have an entry, but it's a placeholder, don't count it */
+ if (entry && HeVAL(entry) == &PL_sv_undef)
+ entry = 0;
+ }
}
if (oldentry && HvLAZYDEL(hv)) { /* was deleted earlier? */
==== //depot/maint-5.8/perl/lib/Hash/Util.t#3 (text) ====
Index: perl/lib/Hash/Util.t
--- perl/lib/Hash/Util.t#2~18256~ Sat Dec 7 10:24:27 2002
+++ perl/lib/Hash/Util.t Sun Dec 8 07:24:00 2002
@@ -6,7 +6,7 @@
chdir 't';
}
}
-use Test::More tests => 157;
+use Test::More tests => 61;
use strict;
my @Exported_Funcs;
@@ -226,60 +226,4 @@
"undef values should not be misunderstood as placeholders");
is ($hash{nowt}, undef,
"undef values should not be misunderstood as placeholders (again)");
-}
-
-{
- # perl #18651 - [EMAIL PROTECTED] found a rather nasty data dependant
- # bug whereby hash iterators could lose hash keys (and values, as the code
- # is common) for restricted hashes.
-
- my @keys = qw(small medium large);
-
- # There should be no difference whether it is restricted or not
- foreach my $lock (0, 1) {
- # Try setting all combinations of the 3 keys
- foreach my $usekeys (0..7) {
- my @usekeys;
- for my $bits (0,1,2) {
- push @usekeys, $keys[$bits] if $usekeys & (1 << $bits);
- }
- my %clean = map {$_ => length $_} @usekeys;
- my %target;
- lock_keys ( %target, @keys ) if $lock;
-
- while (my ($k, $v) = each %clean) {
- $target{$k} = $v;
- }
-
- my $message
- = ($lock ? 'locked' : 'not locked') . ' keys ' . join ',', @usekeys;
-
- is (scalar keys %target, scalar keys %clean, "scalar keys for $message");
- is (scalar values %target, scalar values %clean,
- "scalar values for $message");
- # Yes. All these sorts are necessary. Even for "identical hashes"
- # Because the data dependency of the test involves two of the strings
- # colliding on the same bucket, so the iterator order (output of keys,
- # values, each) depends on the addition order in the hash. And locking
- # the keys of the hash involves behind the scenes key additions.
- is_deeply( [sort keys %target] , [sort keys %clean],
- "list keys for $message");
- is_deeply( [sort values %target] , [sort values %clean],
- "list values for $message");
-
- is_deeply( [sort %target] , [sort %clean],
- "hash in list context for $message");
-
- my (@clean, @target);
- while (my ($k, $v) = each %clean) {
- push @clean, $k, $v;
- }
- while (my ($k, $v) = each %target) {
- push @target, $k, $v;
- }
-
- is_deeply( [sort @target] , [sort @clean],
- "iterating with each for $message");
- }
- }
}
==== //depot/maint-5.8/perl/regcomp.c#6 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#5~18252~ Fri Dec 6 14:19:15 2002
+++ perl/regcomp.c Sun Dec 8 07:24:00 2002
@@ -5072,23 +5072,6 @@
SAVEVPTR(PL_reg_curpm); /* from regexec.c */
SAVEI32(PL_regnpar); /* () count. */
SAVEI32(PL_regsize); /* from regexec.c */
-
- {
- /* Save $1..$n (#18107: UTF-8 s/(\w+)/uc($1)/e); AMS 20021106. */
- int i;
- GV *mgv;
- REGEXP *rx;
- char digits[16];
-
- if (PL_curpm && (rx = PM_GETRE(PL_curpm))) {
- for (i = 1; i <= rx->nparens; i++) {
- sprintf(digits, "%lu", i);
- if ((mgv = gv_fetchpv(digits, FALSE, SVt_PV)))
- save_scalar(mgv);
- }
- }
- }
-
#ifdef DEBUGGING
SAVEPPTR(PL_reg_starttry); /* from regexec.c */
#endif
==== //depot/maint-5.8/perl/t/op/lc.t#4 (text) ====
Index: perl/t/op/lc.t
--- perl/t/op/lc.t#3~18253~ Sat Dec 7 07:35:43 2002
+++ perl/t/op/lc.t Sun Dec 8 07:24:00 2002
@@ -6,7 +6,7 @@
require './test.pl';
}
-plan tests => 55;
+plan tests => 51;
$a = "HELLO.* world";
$b = "hello.* WORLD";
@@ -123,18 +123,3 @@
is(uc("\x{1C5}") , "\x{1C4}", "U+01C5 uc is U+01C4");
is(uc("\x{1C6}") , "\x{1C4}", "U+01C6 uc is U+01C4, too");
-# #18107: A host of bugs involving [ul]c{,first}. AMS 20021106
-$a = "\x{3c3}foo.bar"; # \x{3c3} == GREEK SMALL LETTER SIGMA.
-$b = "\x{3a3}FOO.BAR"; # \x{3a3} == GREEK CAPITAL LETTER SIGMA.
-
-($c = $b) =~ s/(\w+)/lc($1)/ge;
-is($c , $a, "Using s///e to change case.");
-
-($c = $a) =~ s/(\w+)/uc($1)/ge;
-is($c , $b, "Using s///e to change case.");
-
-($c = $b) =~ s/(\w+)/lcfirst($1)/ge;
-is($c , "\x{3c3}FOO.bAR", "Using s///e to change case.");
-
-($c = $a) =~ s/(\w+)/ucfirst($1)/ge;
-is($c , "\x{3a3}foo.Bar", "Using s///e to change case.");
End of Patch.