once again, temp def ref counts seem to be correct
pr_def.c:
	reset recycled temp defs
This commit is contained in:
Bill Currie 2001-11-13 23:17:32 +00:00
parent ad5deea582
commit cfa47717c6
2 changed files with 4 additions and 2 deletions

View file

@ -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);
}

View file

@ -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;