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
Native array[int] accepts junction with negative index #6187
Comments
From eigil@skjaeve.land
It seems the native int array treats negative indices in a junction as This is Rakudo version 2017.01-58-gd06d7c16b built on MoarVM version 2017.01-13-g4aab5064 |
From @lizmat
Any expression resulting in a negative value at runtime, exposes this behaviour: $ 6 'my int @a = ^10; my $a = 0; dd @a[$a-1]’ At the moment, this happens because the AT-POS candidate |
The RT System itself - Status changed from 'new' to 'open' |
From @lizmat
Any expression resulting in a negative value at runtime, exposes this behaviour: $ 6 'my int @a = ^10; my $a = 0; dd @a[$a-1]’ At the moment, this happens because the AT-POS candidate directly uses nqp::atposref_i for performance reasons. Exactly for that reason, I don’t think we should fix this at the Perl 6 level, because we would lose a *lot* of performance if we did. So, *if* we consider this to be a bug (and personally, I think it is), the index checking should happen at the VM level, rather than at the Perl 6 level. |
From @lizmat
Hmmm… the loss in performance appears to be in the 10% range, so maybe not as bad as I anticipated. Liz |
Migrated from rt.perl.org#131134 (status was 'open')
Searchable as RT131134$
The text was updated successfully, but these errors were encountered: