make derefencing a pointer without an offset more efficient

This commit is contained in:
Bill Currie 2003-05-13 19:49:23 +00:00
parent f59f766af1
commit 094c9c5cdb

View file

@ -2038,8 +2038,12 @@ array_expr (expr_t *array, expr_t *index)
if (array_type->type == ev_array) {
e = address_expr (array, index, array_type->aux_type);
} else {
if (index->type != ex_short || index->e.integer_val) {
e = new_binary_expr ('.', array, index);
e->e.expr.type = pointer_type (array_type->aux_type);
} else {
e = array;
}
}
e = unary_expr ('.', e);
return e;