develooper Front page | perl.perl5.porters | Postings from October 2013

[perl #120075] repetition operator does not throw error when right operand is too large

Thread Next
From:
James E Keenan via RT
Date:
October 3, 2013 01:16
Subject:
[perl #120075] repetition operator does not throw error when right operand is too large
Message ID:
rt-3.6.HEAD-31239-1380762982-510.120075-15-0@perl.org
On Wed Oct 02 05:40:38 2013, vsespb wrote:
> $perl -e 'print length("x" x (2**30)), "\n"'
> 1073741824
> 
> $perl -e 'print length("x" x (2**60)), "\n"'
> Out of memory!
> panic: fold_constants JMPENV_PUSH returned 2 at -e line 1.
> 
> $perl -e 'print length("x" x (2**99)), "\n"'
> 0
> 

On the dromedary server, which is also x86_64-linux, the threshold for
flipping to '0' as the output seems to be somewhere between 2**62 and
2**63 (fwiw).



---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=120075

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About