diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index 69ab2c0de..fa50d42b8 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -1547,6 +1547,8 @@ field_expr (expr_t *e1, expr_t *e2) e1 = cast_expr (pointer_type (ivar->type), e1); return unary_expr ('.', e1); } + } else if (is_algebra (t1)) { + return algebra_field_expr (e1, e2); } else if (is_nonscalar (t1) || is_struct (t1) || is_union (t1)) { symbol_t *field; @@ -1587,8 +1589,6 @@ field_expr (expr_t *e1, expr_t *e2) return new_offset_alias_expr (field->type, e1, field->s.offset); } } - } else if (is_algebra (t1)) { - return algebra_field_expr (e1, e2); } else if (is_class (t1)) { //Class instance variables aren't allowed and thus declaring one //is treated as an error, so this is a follow-on error. diff --git a/tools/qfcc/source/expr_algebra.c b/tools/qfcc/source/expr_algebra.c index 3599d9801..20c8ca42a 100644 --- a/tools/qfcc/source/expr_algebra.c +++ b/tools/qfcc/source/expr_algebra.c @@ -2267,5 +2267,15 @@ algebra_field_expr (expr_t *mvec, expr_t *field_name) } return new_offset_alias_expr (field->type, mvec, field->s.offset); } - internal_error (mvec, "not implemented"); + if (mvec->type == ex_multivec) { + internal_error (mvec, "not implemented"); + } else { + auto multivec = mvec_type->t.multivec; + auto mvec_struct = multivec->mvec_sym->type; + auto field = get_struct_field (mvec_struct, mvec, field_name); + if (!field) { + return mvec; + } + return new_offset_alias_expr (field->type, mvec, field->s.offset); + } }