diff --git a/tools/qfcc/source/emit.c b/tools/qfcc/source/emit.c index fccdec5e4..8a7540df4 100644 --- a/tools/qfcc/source/emit.c +++ b/tools/qfcc/source/emit.c @@ -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) diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index 147325b1c..a693e50ca 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -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; }