/* The following two functions are only used when array bounds checking is turned on. Otherwise, they are replaced by macros in array.h. */ ATYPE get_array_item_defcheck (int index, ARRAY_T* array) { check_null_array(array); array_bounds_check(index, array); return(array->items[index]); }
void incr_array_item (int index, ATYPE value, ARRAY_T* array) { check_null_array(array); array_bounds_check(index, array); array->items[index] += value; }
void set_array_item_defcheck (int index, ATYPE value, ARRAY_T* array) { check_null_array(array); array_bounds_check(index, array); array->items[index] = value; }
bbtype_t pusharr(char* id, bbtype_t index_type) { std::string id_str(id); typechk_index(index_type); sym_t* st_entry = lookup_valid(id_str); bbtype_t id_type = st_entry->type; inst("pop rbx"); array_bounds_check(st_entry); if (st_entry->local) { int offset = st_entry->stack_offset * 8 + 8; inst("neg rbx"); inst("push QWORD [r12 + rbx * 8 - %d]", offset); } else { inst("push QWORD [%s_%d + rbx * 8]", id, st_entry->scope); } return id_type; }