Can't call harr withFill before adding data to array
This commit is contained in:
parent
05401547c1
commit
11e3db1787
@ -194,18 +194,15 @@ static B compress_grouped(u64* wp, B x, usz wia, usz wsum, u8 xt) {
|
|||||||
if (xl>0 || csz%8==0) { // Full bytes
|
if (xl>0 || csz%8==0) { // Full bytes
|
||||||
u64 width = xl==0 ? csz/8 : csz << (xl-3);
|
u64 width = xl==0 ? csz/8 : csz << (xl-3);
|
||||||
u8* xp; u8* rp;
|
u8* xp; u8* rp;
|
||||||
bool is_B = TI(x,elType) == el_B;
|
bool is_B = TI(x,elType) == el_B; HArr_p rh;
|
||||||
if (!is_B) {
|
if (!is_B) {
|
||||||
xp = tyany_ptr(x);
|
xp = tyany_ptr(x);
|
||||||
rp = m_tyarrv(&r,width,wsum,xt);
|
rp = m_tyarrv(&r,width,wsum,xt);
|
||||||
} else {
|
} else {
|
||||||
B xf = getFillQ(x);
|
|
||||||
xp = (u8*)arr_bptr(x);
|
xp = (u8*)arr_bptr(x);
|
||||||
usz ria = wsum*csz;
|
usz ria = wsum*csz;
|
||||||
if (xp != NULL) {
|
if (xp != NULL) {
|
||||||
HArr_p rh = m_harrUv(ria);
|
rh = m_harrUv(ria);
|
||||||
r = withFill(rh.b, xf);
|
|
||||||
IA(r) = wsum; // Shape-setting code at end of compress expects this
|
|
||||||
rp = (u8*)rh.a;
|
rp = (u8*)rh.a;
|
||||||
} else {
|
} else {
|
||||||
SLOW2("𝕨/𝕩", w, x);
|
SLOW2("𝕨/𝕩", w, x);
|
||||||
@ -213,13 +210,17 @@ static B compress_grouped(u64* wp, B x, usz wia, usz wsum, u8 xt) {
|
|||||||
for (usz i = 0; i < wia; i++) if (bitp_get(wp,i)) {
|
for (usz i = 0; i < wia; i++) if (bitp_get(wp,i)) {
|
||||||
for (usz j = 0; j < csz; j++) HARR_ADDA(rp, Get(x,i*csz+j));
|
for (usz j = 0; j < csz; j++) HARR_ADDA(rp, Get(x,i*csz+j));
|
||||||
}
|
}
|
||||||
return withFill(HARR_FV(rp), xf);
|
return withFill(HARR_FV(rp), getFillQ(x));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#define MEM_CPY(R,RI,X,XI,L) memcpy(R+RI, X+XI, L)
|
#define MEM_CPY(R,RI,X,XI,L) memcpy(R+RI, X+XI, L)
|
||||||
COMPRESS_GROUP(MEM_CPY)
|
COMPRESS_GROUP(MEM_CPY)
|
||||||
#undef MEM_CPY
|
#undef MEM_CPY
|
||||||
if (is_B) for (usz i = 0; i < wsum*csz; i++) inc(((B*)rp)[i]);
|
if (is_B) {
|
||||||
|
for (usz i = 0; i < wsum*csz; i++) inc(((B*)rp)[i]);
|
||||||
|
r = withFill(rh.b, getFillQ(x));
|
||||||
|
IA(r) = wsum; // Shape-setting code at end of compress expects this
|
||||||
|
}
|
||||||
} else { // Bits
|
} else { // Bits
|
||||||
usz width = csz;
|
usz width = csz;
|
||||||
u64* xp = tyany_ptr(x);
|
u64* xp = tyany_ptr(x);
|
||||||
@ -495,7 +496,6 @@ B slash_c2(B t, B w, B x) {
|
|||||||
if (we > el_i32) { w = any_squeeze(w); we = TI(w,elType); }
|
if (we > el_i32) { w = any_squeeze(w); we = TI(w,elType); }
|
||||||
if (we==el_bit) {
|
if (we==el_bit) {
|
||||||
wbool:
|
wbool:
|
||||||
if (xl > 6 && TI(x,elType) == el_B) goto base; // TODO: fix bugs, enable
|
|
||||||
B r = compress(w, x, wia, xl, xt);
|
B r = compress(w, x, wia, xl, xt);
|
||||||
decG(w); decG(x); return r;
|
decG(w); decG(x); return r;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user