These kinds of expressions currently cannot be handled
without pionter support in the qcvm without scanning the
ast from within ast_member::codegen for an assignments as
seen in the added test case.
This change makes code like that return a pointer type which
will cause an error that we did not get a vector or field
back. With pointer support this pointer could actually be
used instead.
So at least it shouldn't silently produce broken code
anymore.
Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com>
When ast_member encounters the result of an ast_entfield it
has to replace the ast_entfield's codegen as we cannot
evaluate the field access first.
We then perform the same action as ast_entfield but call
vectorMember on the field before issuing the load/address
instruction.
This effectively turns the codegen of the following ast
structure:
member_of {
field_of {
entity,
a_vector
}
memberid
}
into the one of this structure:
field_of {
entity,
member_of {
a_vector
memberid
}
}