fix broken arr_bptr path in transpose_noshape

This commit is contained in:
dzaima 2024-09-09 17:46:46 +03:00
parent 153850921b
commit 03fbb17246
2 changed files with 3 additions and 2 deletions

View File

@ -145,7 +145,7 @@ static Arr* transpose_noshape(B* px, usz ia, usz w, usz h) {
Arr* r;
if (xe==el_B) {
B xf = getFillR(x);
B* xp = TO_BPTR(x);
B* xp = TO_BPTR_RUN(x, *px = x);
HArr_p p = m_harrUv(ia); // Debug build complains with harrUp
transpose_move(p.a, xp, el_f64, w, h);

View File

@ -115,7 +115,8 @@ static B* hslice_ptr(B x) { return hslicev_ptr(a(x)); }
Arr* cpyHArr(B x); // consumes
static HArr* toHArr(B x) { return TY(x)==t_harr? c(HArr,x) : (HArr*) cpyHArr(x); }
#define TO_BPTR(X) ({ B* bp_ = arr_bptr(X); if (bp_==NULL) { HArr* nha_ = (HArr*)cpyHArr(X); X=taga(nha_); bp_=nha_->a; }; bp_; })
#define TO_BPTR_RUN(X, F) ({ B* bp_ = arr_bptr(X); if (bp_==NULL) { HArr* nha_ = (HArr*)cpyHArr(X); X=taga(nha_); bp_=nha_->a; F; }; bp_; })
#define TO_BPTR(X) TO_BPTR_RUN(X, )
B m_caB(usz ia, B* a);