diff --git a/tools/qfcc/include/statements.h b/tools/qfcc/include/statements.h index 195a63d76..133e397c1 100644 --- a/tools/qfcc/include/statements.h +++ b/tools/qfcc/include/statements.h @@ -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; diff --git a/tools/qfcc/source/flow.c b/tools/qfcc/source/flow.c index b94465912..5620d388a 100644 --- a/tools/qfcc/source/flow.c +++ b/tools/qfcc/source/flow.c @@ -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); diff --git a/tools/qfcc/source/statements.c b/tools/qfcc/source/statements.c index bed9e11fd..3d456f0b4 100644 --- a/tools/qfcc/source/statements.c +++ b/tools/qfcc/source/statements.c @@ -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;