Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LTA error message when referring to capture variable exceeding 2**31-1 in Rakudo #3079

Closed
p6rt opened this issue Mar 14, 2013 · 6 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Mar 14, 2013

Migrated from rt.perl.org#117161 (status was 'resolved')

Searchable as RT117161$

@p6rt
Copy link
Author

p6rt commented Mar 14, 2013

From @masak

<diakopter> masak​: here's a fun one​:
<diakopter> r​: $1111111111111111111
<p6eval> rakudo 1c9939​: OUTPUT«Cannot use negative index -2147483648
on Any [...]
<jnthn> I see these are submissions to be tagged [WEIRD] :P
<diakopter> r​: $2147483647
<p6eval> rakudo 1c9939​: ( no output )
<diakopter> r​: $2147483648
<p6eval> rakudo 1c9939​: OUTPUT«Cannot use negative index -2147483648 [...]
* masak submits rakudobug

@p6rt
Copy link
Author

p6rt commented Nov 26, 2014

From @usev6

For Moar the limit now seems to be at 2**63 - 2**9 (on a 64-bit system)​:

$ perl6-m -e '$9223372036854775295'
$ perl6-m -e '$9223372036854775296'
Unhandled exception​: Calculated index (-9223372036854775808) is negative, but Any allows only 0-based indexing
[...]

For Parrot the limit seems to be 2**63 - 2**10 + 2**7 - 2**4 + 2**2 (don't ask)​:

$ perl6-p -e '$9223372036854774899'
$ perl6-p -e '$9223372036854774900'
Calculated index (-9223372036854775808) is negative, but Any allows only 0-based indexing
[...]

JVM can handle even larger numbers as variable names​:

$ perl6-j -e '$92233720368547752960000'

I guess the error message comes from trying to access the respective element of $/ via a subscript​: When we get an integer overflow we also get said error message since negative subscripts are not allowed.

So, what shall be done about this? I don't think it's worth it to generate a special error message for such large capture variables.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Nov 26, 2014

From @usev6

For Moar the limit now seems to be at 2**63 - 2**9 (on a 64-bit system)​:

$ perl6-m -e '$9223372036854775295'
$ perl6-m -e '$9223372036854775296'
Unhandled exception​: Calculated index (-9223372036854775808) is negative, but Any allows only 0-based indexing
[...]

For Parrot the limit seems to be 2**63 - 2**10 + 2**7 - 2**4 + 2**2 (don't ask)​:

$ perl6-p -e '$9223372036854774899'
$ perl6-p -e '$9223372036854774900'
Calculated index (-9223372036854775808) is negative, but Any allows only 0-based indexing
[...]

JVM can handle even larger numbers as variable names​:

$ perl6-j -e '$92233720368547752960000'

I guess the error message comes from trying to access the respective element of $/ via a subscript​: When we get an integer overflow we also get said error message since negative subscripts are not allowed.

So, what shall be done about this? I don't think it's worth it to generate a special error message for such large capture variables.

@p6rt
Copy link
Author

p6rt commented Nov 26, 2014

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

From @diakopter

14​:14 <diakopter> m​: $9223372036854775296
14​:14 <camelia> rakudo-moar 61d231​: ( no output )
14​:15 <diakopter> m​: $922337203685477529623423423423423423234234234234234
14​:15 <camelia> rakudo-moar 61d231​: ( no output )

@p6rt
Copy link
Author

p6rt commented Apr 7, 2016

@diakopter - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant