mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Rewrite expr_alias().
Modifying the existing alias chain proved to be a bad idea (in retrospect, I should have known better:P). Instead, just walk down any existing alias chain to the root operand and build a new alias from that.
This commit is contained in:
parent
215ff61216
commit
31b07bcbbf
1 changed files with 5 additions and 7 deletions
|
@ -748,15 +748,13 @@ expr_expr (sblock_t *sblock, expr_t *e, operand_t **op)
|
|||
static sblock_t *
|
||||
expr_alias (sblock_t *sblock, expr_t *e, operand_t **op)
|
||||
{
|
||||
operand_t *aop = 0;
|
||||
sblock = statement_subexpr (sblock, e->e.expr.e1, &aop);
|
||||
while (aop->op_type == op_alias)
|
||||
aop = aop->o.alias;
|
||||
*op = new_operand (op_alias);
|
||||
(*op)->type = low_level_type (e->e.expr.type);
|
||||
sblock = statement_subexpr (sblock, e->e.expr.e1, &(*op)->o.alias);
|
||||
while ((*op)->o.alias->op_type == op_alias) {
|
||||
operand_t *top = (*op)->o.alias;
|
||||
(*op)->o.alias = (*op)->o.alias->o.alias;
|
||||
top->op_type = op_symbol; // so free_operand won't follow the alias
|
||||
free_operand (top);
|
||||
}
|
||||
(*op)->o.alias = aop;
|
||||
return sblock;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue