mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-23 10:50:58 +00:00
Ensure alias operands are never nested.
No more than one level of aliasing is ever needed, so strip off any intervening aliases that show up.
This commit is contained in:
parent
6621a42da9
commit
095210893f
2 changed files with 7 additions and 1 deletions
|
@ -149,7 +149,7 @@ add_statement_def_ref (def_t *def, dstatement_t *st, int field)
|
|||
free_def (a);
|
||||
}
|
||||
if (alias_depth > 1) {
|
||||
bug (&alias_depth_expr, "alias chain detected: %d %s",
|
||||
internal_error (&alias_depth_expr, "alias chain detected: %d %s",
|
||||
alias_depth, def->name);
|
||||
}
|
||||
if (offset_reloc)
|
||||
|
|
|
@ -784,6 +784,12 @@ expr_alias (sblock_t *sblock, expr_t *e, operand_t **op)
|
|||
*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->type = op_symbol; // so free_operand won't follow the alias
|
||||
free_operand (top);
|
||||
}
|
||||
return sblock;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue