mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
create the temp def for bound defs properly
This commit is contained in:
parent
cb6eba87ca
commit
e9ca03416a
1 changed files with 7 additions and 5 deletions
|
@ -102,14 +102,15 @@ add_statement_ref (def_t *def, dstatement_t *st, int field)
|
||||||
if (def) {
|
if (def) {
|
||||||
int st_ofs = st - pr.code->code;
|
int st_ofs = st - pr.code->code;
|
||||||
|
|
||||||
|
def->users--;
|
||||||
|
def->used = 1;
|
||||||
|
|
||||||
if (def->alias) {
|
if (def->alias) {
|
||||||
def = def->alias;
|
def = def->alias;
|
||||||
|
def->used = 1;
|
||||||
reloc_op_def_ofs (def, st_ofs, field);
|
reloc_op_def_ofs (def, st_ofs, field);
|
||||||
} else
|
} else
|
||||||
reloc_op_def (def, st_ofs, field);
|
reloc_op_def (def, st_ofs, field);
|
||||||
|
|
||||||
def->users--;
|
|
||||||
def->used = 1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -313,9 +314,10 @@ emit_bind_expr (expr_t *e1, expr_t *e2)
|
||||||
}
|
}
|
||||||
def = emit_sub_expr (e1, e2->e.temp.def);
|
def = emit_sub_expr (e1, e2->e.temp.def);
|
||||||
if (t1 != t2) {
|
if (t1 != t2) {
|
||||||
def_t *tmp = new_def (t2, 0, current_scope);
|
def_t *tmp = new_def (t2, 0, def->scope);
|
||||||
|
|
||||||
tmp->ofs = def->ofs;
|
tmp->ofs = 0;
|
||||||
|
tmp->alias = def;
|
||||||
tmp->users = e2->e.temp.users;
|
tmp->users = e2->e.temp.users;
|
||||||
tmp->freed = 1; // don't free this offset when freeing def
|
tmp->freed = 1; // don't free this offset when freeing def
|
||||||
def = tmp;
|
def = tmp;
|
||||||
|
|
Loading…
Reference in a new issue