fix 𝕨/𝕩 doing unchecked multiplications on +´𝕨
both that explicit one, and ones in the allocation functions
This commit is contained in:
parent
3b5497e329
commit
36ba160477
@ -666,6 +666,7 @@ B slash_c2(B t, B w, B x) {
|
||||
goto arrW_base;
|
||||
}
|
||||
s = usum(w);
|
||||
if (s>=USZ_MAX) thrOOM();
|
||||
if (xl>6 || (xl<3 && xl!=0)) goto arrW_base;
|
||||
if (s<=wia) {
|
||||
if (s==0) { r = zeroCells(x); goto decWX_ret; }
|
||||
@ -678,8 +679,11 @@ B slash_c2(B t, B w, B x) {
|
||||
arrW_base:
|
||||
SLOW2("𝕨/𝕩", w, x);
|
||||
B xf = getFillR(x);
|
||||
ux ria = s;
|
||||
usz csz = arr_csz(x);
|
||||
MAKE_MUT_INIT(r0, s*csz, TI(x,elType)); MUTG_INIT(r0);
|
||||
mulOn(ria, csz);
|
||||
if (s>=USZ_MAX) thrOOM();
|
||||
MAKE_MUT_INIT(r0, ria, TI(x,elType)); MUTG_INIT(r0);
|
||||
SGetU(w)
|
||||
B wc; usz ri=0;
|
||||
if (csz!=1) { for (ux i=0; i<wia; i++) { if (!q_usz(wc=GetU(w,i))) goto pfree; usz c=o2sG(wc); for(ux j=0;j<c;j++) { mut_copyG(r0, ri, x, i*csz, csz); ri+= csz; } } }
|
||||
|
||||
@ -122,6 +122,9 @@ w←1‿1⥊1 ⋄ x←2⥊1 ⋄ w‿x <¨↩ ⋄ {! (∾⟨"𝕨",•Repr𝕩,
|
||||
!"Integer out of range: 4.611686018427388e18" % ⟨1,2⋆62⟩ / 2⥊<⋈0 %USZ32
|
||||
!"Out of memory" % ⟨1,2⋆62⟩ / 2‿2⥊<⋈0 %USZ64
|
||||
!"Out of memory" % ⟨1,2⋆62⟩ / 2⥊<⋈0 %USZ64
|
||||
!"Out of memory" % (1e13×↕1000) / ↕1000
|
||||
!"Out of memory" % (16 ⥊ ¯1e9 + 2⋆60) / ↕16
|
||||
!"Out of memory" % (4⥊2⋆60)/⟨4,2⋆8⟩⥊1
|
||||
⟨↕4, 0, ↕5⟩ / 4‿4‿5⥊@ %% 6‿0‿10⥊@
|
||||
⟨↕4, 4⥊0, ↕5⟩ / 4‿4‿5⥊@ %% 6‿0‿10⥊@
|
||||
1‿0‿2 / ⋈¨ ["ab","cd","ef"] %% ⋈¨ ["ab","ef","ef"]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user