getting made readonly on interpreter clone. Also, remove the
:unique attribute from the hashes in warnings.pm, since they may
later be modified by warnings::register. Finally, adds tests for
the :unique attribute.
p4raw-id: //depot/perl@22034
# call is() from within the DESTROY() function at global destruction time,
# and parts of Test::* may have already been freed by then
# call is() from within the DESTROY() function at global destruction time,
# and parts of Test::* may have already been freed by then
print "${not}ok $test - Are we able to call Config::myconfig after clone\n";
$test++;
print "${not}ok $test - Are we able to call Config::myconfig after clone\n";
$test++;
+# bugid 24383 - :unique hashes weren't being made readonly on interpreter
+# clone; check that they are.
+
+our $unique_scalar : unique;
+our @unique_array : unique;
+our %unique_hash : unique;
+threads->new(
+ sub {
+ eval { $unique_scalar = 1 };
+ print $@ =~ /read-only/ ? '' : 'not ', "ok $test - unique_scalar\n";
+ $test++;
+ eval { $unique_array[0] = 1 };
+ print $@ =~ /read-only/ ? '' : 'not ', "ok $test - unique_array\n";
+ $test++;
+ eval { $unique_hash{abc} = 1 };
+ print $@ =~ /disallowed/ ? '' : 'not ', "ok $test - unique_hash\n";
+ $test++;
+ }
+)->join;
+
-our %Offsets : unique = (
# Warnings Categories added in Perl 5.008
# Warnings Categories added in Perl 5.008
'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..47]
'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [29]
'assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [47]
'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..47]
'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [29]
'assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [47]
'y2k' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [46]
);
'y2k' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [46]
);
-our %DeadBits : unique = (
'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..47]
'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [29]
'assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [47]
'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..47]
'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [29]
'assertions' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [47]
GvHV(gv) = (HV*)sv;
}
else {
GvHV(gv) = (HV*)sv;
}
else {
- SvREADONLY_on(GvAV(gv));
+ SvREADONLY_on(GvHV(gv));
}
return sstr; /* he_dup() will SvREFCNT_inc() */
}
return sstr; /* he_dup() will SvREFCNT_inc() */
#$list{'all'} = [ $offset .. 8 * ($warn_size/2) - 1 ] ;
$last_ver = 0;
#$list{'all'} = [ $offset .. 8 * ($warn_size/2) - 1 ] ;
$last_ver = 0;
-print PM "our %Offsets : unique = (\n" ;
+print PM "our %Offsets = (\n" ;
foreach my $k (sort { $a <=> $b } keys %ValueToName) {
my ($name, $version) = @{ $ValueToName{$k} };
$name = lc $name;
foreach my $k (sort { $a <=> $b } keys %ValueToName) {
my ($name, $version) = @{ $ValueToName{$k} };
$name = lc $name;
-print PM "our %Bits : unique = (\n" ;
+print PM "our %Bits = (\n" ;
foreach $k (sort keys %list) {
my $v = $list{$k} ;
foreach $k (sort keys %list) {
my $v = $list{$k} ;
-print PM "our %DeadBits : unique = (\n" ;
+print PM "our %DeadBits = (\n" ;
foreach $k (sort keys %list) {
my $v = $list{$k} ;
foreach $k (sort keys %list) {
my $v = $list{$k} ;