mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
expr.c:
once again, temp def ref counts seem to be correct pr_def.c: reset recycled temp defs
This commit is contained in:
parent
ad5deea582
commit
cfa47717c6
2 changed files with 4 additions and 2 deletions
|
@ -888,11 +888,13 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
|
|||
if (op == '=' && e1->type == ex_def)
|
||||
PR_DefInitialized (e1->e.def);
|
||||
|
||||
if (op == '=')
|
||||
inc_users (e1);
|
||||
|
||||
if (e1->type == ex_block && e1->e.block.is_call
|
||||
&& e2->type == ex_block && e2->e.block.is_call
|
||||
&& e1->e.block.result) {
|
||||
e = new_temp_def_expr (e1->e.block.result->e.def->type);
|
||||
inc_users (e);
|
||||
e1 = binary_expr ('=', e, e1);
|
||||
}
|
||||
|
||||
|
|
|
@ -252,13 +252,13 @@ PR_GetTempDef (type_t *type, def_t *scope)
|
|||
if (free_temps[size]) {
|
||||
def = free_temps[size];
|
||||
free_temps[size] = def->next;
|
||||
memset (def, 0, sizeof (def_t));
|
||||
def->type = type;
|
||||
} else {
|
||||
def = PR_NewDef (type, 0, scope);
|
||||
def->ofs = *scope->alloc;
|
||||
*scope->alloc += pr_type_size[size];
|
||||
}
|
||||
def->users = 0;
|
||||
def->next = temp_scope.next;
|
||||
temp_scope.next = def;
|
||||
return def;
|
||||
|
|
Loading…
Reference in a new issue