develooper Front page | perl.perl5.porters | Postings from February 2006

Re: Bug#350369: *a=$a=*b;${"a"}=*a; gets a segmentation fault

Thread Next
Brendan O'Dea
February 26, 2006 04:05
Re: Bug#350369: *a=$a=*b;${"a"}=*a; gets a segmentation fault
Message ID:
forwarded 350369

On Sun, Jan 29, 2006 at 09:40:23AM +0000, Neil Turton wrote:
>Package: perl-base
>Version: 5.8.7-10
>Perl shouldn't get a segmentation fault on valid or invalid input.  I
>think the following code is valid, even if it is ghastly.  :)
[snip: see]

In short, the following segfaults:

  $ perl -e '*a=$a=*b; $a=42'
  Memory fault 

I'm assuming that the problem is a circular assignment within the
expression (since '$a=*b; *a=$a; $a=42' doesn't break).

The simple answer is "don't do that".  This would appear never to have
worked (certainly as far back as 5.005 crashes).


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About