-Subproject commit ff6cac512fe72a7fd108def245b8744708584571
+Subproject commit f8ed98c97d7b938bb3d116e9428e9b52a3e76450
} ArrayInfo;
ANN Type check_array_access(const Env env, const Array_Sub array);
-ANN m_bool emit_array_access(const Emitter emit,
+ANN bool emit_array_access(const Emitter emit,
struct ArrayAccessInfo *const info);
ANN2(1,2) bool check_array_instance(const Env env, Type_Decl *td, Exp* args);
#endif
-Subproject commit 1ce5b946d432ed53fbcdf5d85781f627036049b8
+Subproject commit 1d1f9c36fa7129e4095f86c7ef89f48112672454
return GW_OK;
}
-ANN m_bool emit_array_access(const Emitter emit,
+ANN bool emit_array_access(const Emitter emit,
struct ArrayAccessInfo *const info) {
if (tflag(info->array.type, tflag_typedef))
info->array.type = typedef_base(info->array.type);
.lhs = info->array.exp->type,
.rhs = info->array.type,
.data = (uintptr_t)info};
- return op_emit(emit, &opi);
+ return op_emit(emit, &opi) > 0;
}
ANN static m_bool emit_exp_array(const Emitter emit, const Exp_Array *array) {
.array = *array->array,
.type = e->type,
.is_var = exp_getvar(e)};
- return emit_array_access(emit, &info);
+ return emit_array_access(emit, &info) ? GW_OK : GW_ERROR;
}
ANN static m_bool emit_exp_slice(const Emitter emit, const Exp_Slice *range) {
return check_array_shift(env, bin->rhs, bin->lhs, ">>", exp_self(bin)->loc);
}
-ANN static inline m_bool emit_array_shift(const Emitter emit,
+ANN static inline bool emit_array_shift(const Emitter emit,
const f_instr exec) {
emit_regmove(emit, -SZ_INT);
(void)emit_add_instr(emit, exec);
- return GW_OK;
+ return true;
}
static INSTR(ArrayAppendFront) {
static OP_EMIT(opem_array_sr) {
const Exp_Binary *bin = (Exp_Binary *)data;
if (shift_match(bin->lhs->type, bin->rhs->type))
- return emit_array_shift(emit, ArrayConcatRight);
+ return emit_array_shift(emit, ArrayConcatRight) ? GW_OK : GW_ERROR;
emit_regmove(emit, -SZ_INT);
if (tflag(bin->lhs->type, tflag_compound))
emit_compound_addref(emit, bin->lhs->type, -SZ_INT - bin->lhs->type->size, false);
static OP_EMIT(opem_array_sl) {
const Exp_Binary *bin = (Exp_Binary *)data;
if (shift_match(bin->rhs->type, bin->lhs->type))
- return emit_array_shift(emit, ArrayConcatLeft);
+ return emit_array_shift(emit, ArrayConcatLeft) ? GW_OK : GW_ERROR;
if (tflag(bin->rhs->type, tflag_compound))
emit_compound_addref(emit, bin->rhs->type, -bin->rhs->type->size, false);
emit_regmove(emit, -bin->rhs->type->size);
return e->d.exp_slice.base->type;
}
-static inline m_bool bounds(const M_Vector v, const m_int i) {
- CHECK_BB(i);
- return (m_uint)i < ARRAY_LEN(v) ? GW_OK : GW_ERROR;
+static inline bool bounds(const M_Vector v, const m_int i) {
+ CHECK_B(i);
+ return (m_uint)i < ARRAY_LEN(v);
}
static INSTR(ArraySlice) {
if (end < 0) end = ARRAY_LEN(in) + end;
const m_int op = start < end ? 1 : -1;
const m_uint sz = op > 0 ? end - start : start - end;
- if (bounds(in, start) < 0 || bounds(in, end) < 0) {
+ if (!bounds(in, start) || !bounds(in, end)) {
handle(shred, "OutOfBoundsArraySliceException");
return;
}
Exp* exp = emit_n_exp(emit, info);
next.exp = exp;
info->array = next;
- return exp ? emit_array_access(emit, info) : GW_ERROR;
+ if(exp)
+ return emit_array_access(emit, info) ? GW_OK : GW_ERROR;
+ return GW_ERROR;
}
static m_bit map_byte[BYTECODE_SZ * 5];
return GW_OK;
}
-ANN static m_bool emit_next_access(const Emitter emit, struct ArrayAccessInfo *const info) {
+ANN static bool emit_next_access(const Emitter emit, struct ArrayAccessInfo *const info) {
const struct Array_Sub_ array = info->array;
HMapInfo *const hinfo = (HMapInfo*)info->array.type->nspc->class_data;
info->array = (struct Array_Sub_){
const m_bool ret = _opem_dict_access(emit, data);
array->exp->next = enext;
CHECK_BB(ret);
- return !enext ? GW_OK : emit_next_access(emit, info);
+ return !enext ? GW_OK : (emit_next_access(emit, info) ? GW_OK : GW_ERROR);
}
static OP_CHECK(opck_dict_access) {
}
typedef ANN void (*f_connect)(const UGen lhs, const UGen rhs);
-ANN /* static */ void _do_(const f_connect f, const UGen lhs, const UGen rhs) {
- const m_bool l_multi = lhs->multi;
- const m_bool r_multi = rhs->multi;
+ANN static void _do_(const f_connect f, const UGen lhs, const UGen rhs) {
+ const bool l_multi = lhs->multi;
+ const bool r_multi = rhs->multi;
const uint l_max = l_multi ? lhs->connect.multi->n_out : 1;
const uint r_max = r_multi ? rhs->connect.multi->n_in : 1;
const uint max = l_max > r_max ? l_max : r_max;