mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-25 05:01:24 +00:00
[qfcc] Fix nested compound initializers
Add static array indexing. This gets the compoundinit test working.
This commit is contained in:
parent
19965e7cbd
commit
35e2044bfa
2 changed files with 9 additions and 2 deletions
|
@ -1348,10 +1348,17 @@ dag_gencode (dag_t *dag, sblock_t *block, dagnode_t *dagnode)
|
|||
internal_error (dagnode->label->expr, "invalid alias node");
|
||||
}
|
||||
auto value = dagnode->children[0]->value;
|
||||
int offset = 0;
|
||||
if (op_is_alias (value)) {
|
||||
//FIXME? this check shouldn't be necessary, but aliased defs
|
||||
//stay as aliased defs in the dag. I'm not sure this is the
|
||||
//right fix, or even in the right direction
|
||||
if (value->op_type == op_def) {
|
||||
offset = op_alias_offset (value);
|
||||
}
|
||||
value = unalias_op (value);
|
||||
}
|
||||
dst = offset_alias_operand (dagnode->types[0], dagnode->offset,
|
||||
dst = offset_alias_operand (dagnode->types[0], dagnode->offset + offset,
|
||||
value, dagnode->label->expr);
|
||||
if ((var_iter = set_first (dagnode->identifiers))) {
|
||||
type = dst->type;
|
||||
|
|
|
@ -251,7 +251,7 @@ build_element_chain (element_chain_t *element_chain, const type_t *type,
|
|||
|
||||
if (ele->expr && ele->expr->type == ex_compound) {
|
||||
build_element_chain (element_chain, state.type, ele->expr,
|
||||
state.offset);
|
||||
base_offset + state.offset);
|
||||
} else {
|
||||
element_t *element = new_element (0, 0);
|
||||
element->type = state.type;
|
||||
|
|
Loading…
Reference in a new issue