fix ↑‿3⥊3

This commit is contained in:
dzaima 2021-08-22 23:41:37 +03:00
parent a3f87d4dcb
commit 68214dda53
3 changed files with 10 additions and 2 deletions

View File

@ -158,6 +158,14 @@ B shape_c2(B t, B w, B x) {
}
unit:
if (fill && nia>1) {
MAKE_MUT(m, nia); mut_init(m, selfElType(x));
mut_setG(m, 0, x);
mut_fillG(m, 1, xf, nia-1);
Arr* ra = mut_fp(m);
arr_shSetU(ra, nr, sh);
return withFill(taga(ra), xf);
}
if (isF64(x)) { decA(xf);
i32 n = (i32)x.f;
if (n == x.f) {

View File

@ -532,7 +532,7 @@ static u8 fillElType(B x) {
if (isC32(x)) return el_c32;
return el_B;
}
static u8 selfElType(B x) {
static u8 selfElType(B x) { // guaranteed to fit fill
if (isF64(x)) return q_i32(x)? el_i32 : el_f64;
if (isC32(x)) return el_c32;
return el_B;

View File

@ -192,7 +192,7 @@ static void mut_fill(Mut* m, usz ms, B x, usz l) {
mut_to(m, nty);
goto again;
}
static void mut_fillG(Mut* m, usz ms, B x, usz l) {
static void mut_fillG(Mut* m, usz ms, B x, usz l) { // doesn't consume x
switch(m->type) { default: UD;
case el_i32: {
assert(q_i32(x));