fix access to fields of vector members
authorWolfgang Bumiller <wry.git@bumiller.com>
Sat, 19 Nov 2016 15:15:26 +0000 (16:15 +0100)
committerWolfgang Bumiller <wry.git@bumiller.com>
Sat, 19 Nov 2016 15:22:18 +0000 (16:22 +0100)
commit0b94d7583cd56c5c57b35b0891d5fdf6249aaf37
tree5e94f77cfb494da70cb91af3e07810962f7e38af
parent4c48bae203c332ad51367ddc3d89681ef5eb0169
fix access to fields of vector members

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
        }
    }
ast.cpp
tests/vecfields.qc [new file with mode: 0644]
tests/vecfields.tmpl [new file with mode: 0644]