Closed p5pRT closed 20 years ago
pragma/warning......PROG: # op.c $ENV{PERL_DESTRUCT_LEVEL} = 0 unless $ENV{PERL_DESTRUCT_LEVEL} > 3; # known scalar leak use warning 'unsafe' ; my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; @a =~ /abc/ ; @a =~ s/a/b/ ; @a =~ tr/a/b/ ; @$b =~ /abc/ ; @$b =~ s/a/b/ ; @$b =~ tr/a/b/ ; %a =~ /abc/ ; %a =~ s/a/b/ ; %a =~ tr/a/b/ ; %$c =~ /abc/ ; %$c =~ s/a/b/ ; %$c =~ tr/a/b/ ; { no warning 'unsafe' ; my $a ; my @a = () ; my %a = () ; my $b = \@a ; my $c = \%a ; @a =~ /abc/ ; @a =~ s/a/b/ ; @a =~ tr/a/b/ ; @$b =~ /abc/ ; @$b =~ s/a/b/ ; @$b =~ tr/a/b/ ; %a =~ /abc/ ; %a =~ s/a/b/ ; %a =~ tr/a/b/ ; %$c =~ /abc/ ; %$c =~ s/a/b/ ; %$c =~ tr/a/b/ ; } EXPECTED: Applying pattern match to @array will act on scalar(@array) at - line 5. Applying substitution to @array will act on scalar(@array) at - line 6. Can't modify private array in substitution at - line 6\, near "s/a/b/ ;" Applying character translation to @array will act on scalar(@array) at - line 7. Applying pattern match to @array will act on scalar(@array) at - line 8. Applying substitution to @array will act on scalar(@array) at - line 9. Applying character translation to @array will act on scalar(@array) at - line 10. Applying pattern match to %hash will act on scalar(%hash) at - line 11. Applying substitution to %hash will act on scalar(%hash) at - line 12. Applying character translation to %hash will act on scalar(%hash) at - line 13. Applying pattern match to %hash will act on scalar(%hash) at - line 14. Applying substitution to %hash will act on scalar(%hash) at - line 15. Applying character translation to %hash will act on scalar(%hash) at - line 16. BEGIN not safe after errors--compilation aborted at - line 18. GOT: Applying pattern match to @array will act on scalar(@array) at - line 5. Applying substitution to @array will act on scalar(@array) at - line 6. Can't modify private array in substitution at - line 6\, near "s/a/b/ ;" Applying character translation to @array will act on scalar(@array) at - line 7. Applying pattern match to @array will act on scalar(@array) at - line 8. Applying substitution to @array will act on scalar(@array) at - line 9. Applying character translation to @array will act on scalar(@array) at - line 10. Applying pattern match to %hash will act on scalar(%hash) at - line 11. Applying substitution to %hash will act on scalar(%hash) at - line 12. Applying character translation to %hash will act on scalar(%hash) at - line 13. Applying pattern match to %hash will act on scalar(%hash) at - line 14. Applying substitution to %hash will act on scalar(%hash) at - line 15. Applying character translation to %hash will act on scalar(%hash) at - line 16. BEGIN not safe after errors--compilation aborted at - line 18. Scalars leaked: 1
and then later
lib/dprof...........ld.so.1: ../perl: fatal: relocation error: file /vol/lwv26ldatae/lib/perl5/site_perl/5.005/sun4-solaris/auto/Devel/DProf/DProf.so: symbol perl_get_cv: referenced symbol not found FAILED at test 1
Failed 2 test scripts out of 210\, 99.05% okay.
Migrated from rt.perl.org#1106 (status was 'resolved')
Searchable as RT1106$