[qfcc] Update offset for aliased defs

When getting an offset alias of an already aliased def, the offset needs
to be updated so it points to the correct part of the def. This is
actually a rather old bug but it got uncovered somehow with my rework of
the ruamoko semantic processing (probably an altered cast).
This commit is contained in:
Bill Currie 2024-12-07 00:22:53 +09:00
parent 4e3bacd827
commit d08816cb6b

View file

@ -516,8 +516,10 @@ offset_alias_operand (const type_t *type, int offset, operand_t *aop,
return top;
} else if (aop->op_type == op_def) {
def = aop->def;
while (def->alias)
while (def->alias) {
offset += def->offset;
def = def->alias;
}
return def_operand (alias_def (def, type, offset), 0, expr);
} else if (aop->op_type == op_value) {
if (!is_ptr (aop->value->type)) {