mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 06:34:11 +00:00
Handle assignment from void defs.
The main void defs are .return and .param_N. If the source operand is void, use the destination operand's type to alias the source operand rather than the source operand's type to alias the destination's operand (the usual case).
This commit is contained in:
parent
158e261a8f
commit
3cffeb7b66
1 changed files with 8 additions and 2 deletions
|
@ -485,12 +485,18 @@ generate_assignments (dag_t *dag, sblock_t *block, operand_t *src,
|
||||||
{
|
{
|
||||||
statement_t *st;
|
statement_t *st;
|
||||||
operand_t *dst = 0;
|
operand_t *dst = 0;
|
||||||
operand_t *operands[3] = {src, 0, 0};
|
operand_t *operands[3] = {0, 0, 0};
|
||||||
daglabel_t *var;
|
daglabel_t *var;
|
||||||
|
|
||||||
for ( ; var_iter; var_iter = set_next (var_iter)) {
|
for ( ; var_iter; var_iter = set_next (var_iter)) {
|
||||||
var = dag->labels[var_iter->member];
|
var = dag->labels[var_iter->member];
|
||||||
operands[1] = fix_op_type (var->op, src->type);
|
if (src->type == ev_void) {
|
||||||
|
operands[0] = fix_op_type (src, var->op->type);
|
||||||
|
operands[1] = var->op;
|
||||||
|
} else {
|
||||||
|
operands[0] = src;
|
||||||
|
operands[1] = fix_op_type (var->op, src->type);
|
||||||
|
}
|
||||||
if (!dst) {
|
if (!dst) {
|
||||||
dst = operands[1];
|
dst = operands[1];
|
||||||
while (dst->op_type == op_alias)
|
while (dst->op_type == op_alias)
|
||||||
|
|
Loading…
Reference in a new issue