mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
make derefencing a pointer without an offset more efficient
This commit is contained in:
parent
f59f766af1
commit
094c9c5cdb
1 changed files with 6 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue