mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Fix taking the address of normal variables.
Treat them the same as structure variables.
This commit is contained in:
parent
3c1784d46c
commit
a6f222106e
1 changed files with 4 additions and 7 deletions
|
@ -2088,11 +2088,7 @@ address_expr (expr_t *e1, expr_t *e2, type_t *t)
|
|||
def_t *def = e1->e.symbol->s.def;
|
||||
type_t *type = def->type;
|
||||
|
||||
if (is_struct (type) || is_class (type)) {
|
||||
e = new_pointer_expr (0, t, def);
|
||||
e->line = e1->line;
|
||||
e->file = e1->file;
|
||||
} else if (is_array (type)) {
|
||||
if (is_array (type)) {
|
||||
e = e1;
|
||||
e->type = ex_value;
|
||||
e->e.value.type = ev_pointer;
|
||||
|
@ -2100,8 +2096,9 @@ address_expr (expr_t *e1, expr_t *e2, type_t *t)
|
|||
e->e.value.v.pointer.type = t;
|
||||
e->e.value.v.pointer.def = def;
|
||||
} else {
|
||||
e = new_unary_expr ('&', e1);
|
||||
e->e.expr.type = pointer_type (t);
|
||||
e = new_pointer_expr (0, t, def);
|
||||
e->line = e1->line;
|
||||
e->file = e1->file;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue