fix arr⌾(is⊸⊏) highrank range check
This commit is contained in:
parent
3fe7bd89bf
commit
398d387c22
@ -987,9 +987,9 @@ B select_ucw(B t, B o, B w, B x) {
|
||||
usz wia = IA(w);
|
||||
B rep;
|
||||
if (isArr(o) && RNK(x)>0) {
|
||||
usz xia = IA(x);
|
||||
usz xn = *SH(x);
|
||||
i64 buf[2];
|
||||
if (wia!=0 && (!getRange_fns[we](tyany_ptr(w), buf, wia) || buf[0]<-(i64)xia || buf[1]>=xia)) {
|
||||
if (wia!=0 && (!getRange_fns[we](tyany_ptr(w), buf, wia) || buf[0]<-(i64)xn || buf[1]>=xn)) {
|
||||
C2(select, w, x);
|
||||
fatal("select_ucw expected to error");
|
||||
}
|
||||
|
||||
@ -73,6 +73,8 @@ n←500 ⋄ a←↕n ⋄ i←(-n)+↕2×n ⋄ r←⌽(2×n)⥊a ⋄ ! (⌽a) ≡
|
||||
!"𝕨⊏𝕩: Indexing out-of-bounds (10∊𝕨, 10≡≠𝕩)" % %USE evar ⋄ 9‿10 {0‿1⌾(𝕨⊸⊏)𝕩}_evar 10⥊1‿0‿1
|
||||
!"𝕨⊏𝕩: Indexing out-of-bounds (10∊𝕨, 10≡≠𝕩)" % %USE evar ⋄ "ab" {𝕨⌾(9‿10⊸⊏)𝕩}_evar 10⥊"foo"
|
||||
!"𝕨⊏𝕩: Indexing out-of-bounds (4.611686018427388e18∊𝕨, 3≡≠𝕩)" % %USE eqerr ⋄ {𝕩⌾((3⥊2⋆62)⊸⊏) "abc"}_eqerr ⟨"abc", {𝕊: "abc"}⟩
|
||||
!"𝕨⊏𝕩: Indexing out-of-bounds (2∊𝕨, 2≡≠𝕩)" % %USE evar ⋄ (3‿50⥊1‿0‿1) {𝕨⌾(0‿2⊸⊏) 𝕩}_evar 2‿50⥊↕100
|
||||
%USE eqvar ⋄ (2‿0⥊0) {𝕨⌾(0‿1⊸⊏) 𝕩}_eqvar 10‿0⥊2 %% 10‿0⥊0
|
||||
%USE eqerr ⋄ ! ⊑ (<⋈⁼ ⍷{1⊣𝕩⌾((3⥊2⋆63)⊸⊏) "abc"}⎊{𝕊: •CurrentError@}¨ ⟨"abc", {𝕊: "abc"}⟩) ∊ "Integer out of range: 9.223372036854776e18"‿"𝕨⊏𝕩: Indexing out-of-bounds (9.223372036854776e18∊𝕨, 3≡≠𝕩)"
|
||||
!"Expected integer, got 1.1" % %USE eqerr ⋄ {𝕩⌾((3⥊1.1)⊸⊏) ↕3}_eqerr ⟨↕3, {1+𝕩}⟩
|
||||
!"𝕨⊏𝕩: Indexing out-of-bounds (10∊𝕨, 3≡≠𝕩)" % %USE eqerr ⋄ {𝕩⌾(10‿11‿12⊸⊏) ↕3}_eqerr ⟨↕3, {1+𝕩}⟩
|
||||
|
||||
Loading…
Reference in New Issue
Block a user