mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-20 10:43:29 +00:00
prepare PR_Statement for proper temporary usage
This commit is contained in:
parent
e339e82c01
commit
53e9fb65d1
2 changed files with 7 additions and 6 deletions
|
@ -124,15 +124,18 @@ PR_NewDef (type_t *type, const char *name, def_t *scope)
|
|||
def_t *def;
|
||||
|
||||
def = calloc (1, sizeof (def_t));
|
||||
pr.def_tail->next = def;
|
||||
pr.def_tail = def;
|
||||
|
||||
if (name) {
|
||||
pr.def_tail->next = def;
|
||||
pr.def_tail = def;
|
||||
}
|
||||
|
||||
if (scope) {
|
||||
def->scope_next = scope->scope_next;
|
||||
scope->scope_next = def;
|
||||
}
|
||||
|
||||
def->name = strdup (name);
|
||||
def->name = name ? strdup (name) : 0;
|
||||
def->type = type;
|
||||
|
||||
def->scope = scope;
|
||||
|
|
|
@ -154,10 +154,8 @@ PR_Statement (opcode_t * op, def_t * var_a, def_t * var_b)
|
|||
var_c = NULL;
|
||||
statement->c = 0;
|
||||
} else { // allocate result space
|
||||
var_c = malloc (sizeof (def_t));
|
||||
memset (var_c, 0, sizeof (def_t));
|
||||
var_c = PR_NewDef (op->type_c->type, 0, 0);
|
||||
var_c->ofs = numpr_globals;
|
||||
var_c->type = op->type_c->type;
|
||||
|
||||
statement->c = numpr_globals;
|
||||
numpr_globals += type_size[op->type_c->type->type];
|
||||
|
|
Loading…
Reference in a new issue