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

Weird behavior due to overflow when indexing from the back (@a[*-9999999999999999999]:delete) #5870

Open
p6rt opened this issue Dec 7, 2016 · 1 comment
Labels
9999 regression Issue did not exist previously

Comments

@p6rt
Copy link

p6rt commented Dec 7, 2016

Migrated from rt.perl.org#130290 (status was 'new')

Searchable as RT130290$

@p6rt
Copy link
Author

p6rt commented Dec 7, 2016

From @AlexDaniel

Code​:
my @​a = <a b c>; @​a[*-18446744073709551616]​:delete; say @​a

Result (2015.12)​:
Calculated index (-18446744073709551613) is negative, but Array allows only 0-based indexing
  in block <unit> at /tmp/g0zjzkXIcV line 1

Actually thrown at​:
  in block <unit> at /tmp/g0zjzkXIcV line 1

Result (HEAD)​:
[a b c]

Code​:
my @​a = <a b c>; @​a[*-18446744073709551617]​:delete; say @​a

Result (2015.12)​:
Calculated index (-18446744073709551614) is negative, but Array allows only 0-based indexing
  in block <unit> at /tmp/nlSDRWGjik line 1

Actually thrown at​:
  in block <unit> at /tmp/nlSDRWGjik line 1

Result (HEAD)​:
[a b]

Code​:
my @​a = <a b c>; @​a[*-18446744073709551618]​:delete; say @​a

Result (2015.12)​:
Calculated index (-18446744073709551615) is negative, but Array allows only 0-based indexing
  in block <unit> at /tmp/3LuNBo60du line 1

Actually thrown at​:
  in block <unit> at /tmp/3LuNBo60du line 1

Result (HEAD)​:
[a (Any) c]

While the error messages were a bit LTA, at least it was throwing an error.

Bisectable points to this commit​: rakudo/rakudo@6dbacb3

@p6rt p6rt added 9999 regression Issue did not exist previously labels Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9999 regression Issue did not exist previously
Projects
None yet
Development

No branches or pull requests

1 participant