mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Support calls through function temps.
I had forgotten function vars stored in ents and objects would use a temp when calling the function.
This commit is contained in:
parent
5e9d7d3567
commit
848493379d
3 changed files with 9 additions and 0 deletions
|
@ -43,6 +43,7 @@ typedef enum {
|
|||
|
||||
typedef struct {
|
||||
struct def_s *def;
|
||||
struct type_s *type;
|
||||
struct flowvar_s *flowvar;
|
||||
struct daglabel_s *daglabel;
|
||||
int users;
|
||||
|
|
|
@ -575,6 +575,13 @@ get_function_type (operand_t *op)
|
|||
if (op->o.value->type != ev_func)
|
||||
internal_error (0, "not a function value");
|
||||
type = op->o.value->v.func_val.type;
|
||||
} else if (op->op_type == op_temp) {
|
||||
type = op->o.tempop.type;
|
||||
if (type->type != ev_func)
|
||||
internal_error (0, "not a function temp");
|
||||
type = type->t.func.type;
|
||||
} else {
|
||||
internal_error (0, "don't know how to extract function type");
|
||||
}
|
||||
// fixme temps?
|
||||
return low_level_type (type);
|
||||
|
|
|
@ -301,6 +301,7 @@ temp_operand (type_t *type)
|
|||
{
|
||||
operand_t *op = new_operand (op_temp);
|
||||
|
||||
op->o.tempop.type = type;
|
||||
op->type = low_level_type (type);
|
||||
op->size = type_size (type);
|
||||
return op;
|
||||
|
|
Loading…
Reference in a new issue