empty int arr constant

This commit is contained in:
dzaima 2021-05-12 16:37:00 +03:00
parent cd5eb4dfe9
commit 62dbedc9b8
3 changed files with 5 additions and 3 deletions

View File

@ -75,8 +75,8 @@ B fne_c1(B t, B x) {
dec(x); dec(x);
return r; return r;
} else { } else {
dec(x); i32* tmp; dec(x);
return m_i32arrv(&tmp, 0); return inc(bi_emptyIVec);
} }
} }
u64 depth(B x) { // doesn't consume u64 depth(B x) { // doesn't consume

View File

@ -417,7 +417,7 @@ TypeInfo ti[t_COUNT];
#define TI(x) (ti[v(x)->type]) #define TI(x) (ti[v(x)->type])
B bi_N, bi_noVar, bi_badHdr, bi_optOut, bi_noFill, bi_emptyHVec; B bi_N, bi_noVar, bi_badHdr, bi_optOut, bi_noFill, bi_emptyHVec, bi_emptyIVec;
void do_nothing(B x) { } void do_nothing(B x) { }
bool isNothing(B b) { return b.u==bi_N.u; } bool isNothing(B b) { return b.u==bi_N.u; }

View File

@ -77,4 +77,6 @@ static inline void i32arr_init() {
ti[t_i32arr].arrD1 = true; ti[t_i32slice].arrD1 = true; ti[t_i32arr].arrD1 = true; ti[t_i32slice].arrD1 = true;
ti[t_i32arr].elType = el_i32; ti[t_i32slice].elType = el_i32; ti[t_i32arr].elType = el_i32; ti[t_i32slice].elType = el_i32;
ti[t_i32arr].canStore = i32arr_canStore; ti[t_i32arr].canStore = i32arr_canStore;
i32* tmp; bi_emptyIVec = m_i32arrv(&tmp, 0);
gc_add(bi_emptyIVec);
} }