[qfcc] Make struct ptr access consistent with class ivar access

While this does make the generated code a little worse, load is behaving
nicely), the two are at least consistent with each other and when I fix
one, I'll fix both. I missed this change the other day when I did the
address_expr cleanup. Yay near-duplicate code :P
This commit is contained in:
Bill Currie 2022-01-28 09:17:10 +09:00
parent 7877168e93
commit 8d873a891f

View file

@ -1517,10 +1517,10 @@ field_expr (expr_t *e1, expr_t *e2)
if (!field) if (!field)
return e1; return e1;
e2->type = ex_value; expr_t *offset = new_short_expr (field->s.offset);
e2->e.value = new_short_val (field->s.offset); e1 = offset_pointer_expr (e1, offset);
e = new_address_expr (field->type, e1, e2); e1 = cast_expr (pointer_type (field->type), e1);
return unary_expr ('.', e); return unary_expr ('.', e1);
} else if (is_class (t1->t.fldptr.type)) { } else if (is_class (t1->t.fldptr.type)) {
class_t *class = t1->t.fldptr.type->t.class; class_t *class = t1->t.fldptr.type->t.class;
symbol_t *sym = e2->e.symbol;//FIXME need to check symbol_t *sym = e2->e.symbol;//FIXME need to check