2. Compensate for PL_sv_placeholder <= 5.8.1.
3. Clean up non-backwards-compatible tests.
4. Prepare for the 2.08 CPAN release.
p4raw-id: //depot/perl@21051
+Sat Sep 6 01:08:20 IST 2003 Abhijit Menon-Sen <ams@wiw.org>
+
+ Version 2.08
+
+ This release works around a 5.8.0 bug which caused hashes to not
+ be marked as having key flags even though an HEK had HEK_WASUTF8
+ set. (Note that the only reasonable solution is to silently drop
+ the flag from the affected key.)
+
+ Users of RT 3 who were seeing assertion failures should upgrade.
+ (Perl 5.8.1 will have the bug fixed.)
+
Mon May 5 10:24:16 IST 2003 Abhijit Menon-Sen <ams@wiw.org>
Version 2.07
#define STORABLE_BIN_WRITE_MINOR 6
#endif /* (PATCHLEVEL <= 6) */
+#if (PATCHLEVEL <= 8 || (PATCHLEVEL == 8 && SUBVERSION < 1))
+#define PL_sv_placeholder PL_sv_undef
+#endif
+
/*
* Useful store shortcuts...
*/
PUTMARK(flags);
TRACEME(("(#%d) key '%s' flags %x %u", i, keyval, flags, *keyval));
} else {
- assert (flags == 0);
+ /* This is a workaround for a bug in 5.8.0
+ that causes the HEK_WASUTF8 flag to be
+ set on an HEK without the hash being
+ marked as having key flags. We just
+ cross our fingers and drop the flag.
+ AMS 20030901 */
+ assert (flags == 0 || flags == SHV_K_WASUTF8);
TRACEME(("(#%d) key '%s'", i, keyval));
}
WLEN(keylen);
PUTMARK(flags);
TRACEME(("(#%d) key '%s' flags %x", i, key, flags));
} else {
- assert (flags == 0);
+ /* This is a workaround for a bug in 5.8.0
+ that causes the HEK_WASUTF8 flag to be
+ set on an HEK without the hash being
+ marked as having key flags. We just
+ cross our fingers and drop the flag.
+ AMS 20030901 */
+ assert (flags == 0 || flags == SHV_K_WASUTF8);
TRACEME(("(#%d) key '%s'", i, key));
}
if (flags & SHV_K_ISSV) {
thaw $frozen; # used to segfault here
ok 19, 1;
-$a = []; $#$a = 2; $a->[1] = undef;
-$b = thaw freeze $a;
-@a = map { ~~ exists $a->[$_] } 0 .. $#$a;
-@b = map { ~~ exists $b->[$_] } 0 .. $#$b;
-ok 20, "@a" eq "@b";
+if ($] >= 5.006) {
+ eval '
+ $a = []; $#$a = 2; $a->[1] = undef;
+ $b = thaw freeze $a;
+ @a = map { ~~ exists $a->[$_] } 0 .. $#$a;
+ @b = map { ~~ exists $b->[$_] } 0 .. $#$b;
+ ok 20, "@a" eq "@b";
+ ';
+}
+else {
+ print "ok 20 # skipped (no av_exists)\n";
+}
# present in files, but not in things store()ed to memory
$fancy = ($] > 5.007 ? 2 : 0);
-plan tests => 368 + length ($byteorder) * 4 + $fancy * 8;
+plan tests => 368 + length ($byteorder) * 4 + $fancy * 8 + 1;
use Storable qw (store retrieve freeze thaw nstore nfreeze);
# And now try almost everything again with a Storable string
$stored = nfreeze \%hash;
test_things($stored, \&freeze_and_thaw, 'string', 1);
+
+# Test that the bug fixed by #20587 doesn't affect us under some older
+# Perl. AMS 20030901
+{
+ chop(my $a = chr(0xDF).chr(256));
+ my %a = (chr(0xDF) => 1);
+ $a{$a}++;
+ freeze \%a;
+ # If we were built with -DDEBUGGING, the assert() should have killed
+ # us, which will probably alert the user that something went wrong.
+ ok(1);
+}
if ($ENV{PERL_CORE}){
chdir('t') if -d 't';
@INC = ('.', '../lib');
- use vars qw($MacPerl::Architecture);
- push @INC, "::lib:$MacPerl::Architecture:" if $^O eq 'MacOS';
+ if ($^O eq 'MacOS') {
+ # Look, I'm using this fully-qualified variable more than once!
+ my $arch = $MacPerl::Architecture;
+ push @INC, "::lib:${MacPerl::Architecture}:";
+ }
} else {
unshift @INC, 't';
}