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

Defined-or operator lets negative subscript cause a crash #2788

Closed
SqrtNegInf opened this issue Mar 23, 2019 · 3 comments
Closed

Defined-or operator lets negative subscript cause a crash #2788

SqrtNegInf opened this issue Mar 23, 2019 · 3 comments
Labels
BLOCKER Preventing the next release of rakudo, or just needing attention before the release regression Issue did not exist previously tests needed Issue is generally resolved but tests were not written yet

Comments

@SqrtNegInf
Copy link

The Problem

Given:
my @a = 1..2 Z 'a'..'b';

These work as they should
say @a[ $_][ 1] // 42 for <0 -1>; # prints 'a' and '42'
say @a[*-1][$_] // 42 for <0 -1>; # prints '2' and '42'

But // fails to catch the negative subscript value (in the 1st dimension)
when subscripting with *-1 (in the 2nd dimension)
say @a[$_][*-1] // 42 for <0 -1>;
Fails with "Index out of range. Is: -1, should be in 0..^Inf"

Environment

Failure first seen with:
Rakudo version 2019.03-40-g4ffb4082b built on MoarVM version 2019.03-31-g6c7810ce7

@AlexDaniel AlexDaniel added regression Issue did not exist previously BLOCKER Preventing the next release of rakudo, or just needing attention before the release labels Mar 23, 2019
@AlexDaniel
Copy link
Contributor

AlexDaniel commented Apr 15, 2019

Bisected: 4ffb408

Ping @lizmat

@lizmat
Copy link
Contributor

lizmat commented Apr 15, 2019

Fixed with 7bbbebc and 9ce87ee

@lizmat lizmat added the tests needed Issue is generally resolved but tests were not written yet label Apr 15, 2019
@lizmat
Copy link
Contributor

lizmat commented Apr 23, 2019

Tests added with Raku/roast@1e29231ed5f0223ff64e01 . So closing.

@lizmat lizmat closed this as completed Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BLOCKER Preventing the next release of rakudo, or just needing attention before the release regression Issue did not exist previously tests needed Issue is generally resolved but tests were not written yet
Projects
None yet
Development

No branches or pull requests

3 participants