From 0eda63548374b4386090f3dfb295b474e172168d Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Wed, 22 Aug 2001 23:21:47 +0000 Subject: [PATCH] fix temp reference counting on function call args --- tools/qfcc/source/expr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/qfcc/source/expr.c b/tools/qfcc/source/expr.c index e04018a46..478b99a31 100644 --- a/tools/qfcc/source/expr.c +++ b/tools/qfcc/source/expr.c @@ -363,7 +363,8 @@ print_expr (expr_t *e) } else { printf("<>"); } - printf (":%s)@", type_names [e->e.temp.type->type]); + printf (":%s:%d)@", type_names [e->e.temp.type->type], + e->e.temp.users); break; case ex_string: printf ("\"%s\"", e->e.string_val); @@ -1082,6 +1083,8 @@ function_expr (expr_t *e1, expr_t *e2) call = new_block_expr (); for (e = e2, i = 0; e; e = e->next, i++) { *a = new_temp_def_expr (arg_types[i]); + if (i) // compensate for new_binary_expr and the first arg + inc_users(*a); append_expr (call, binary_expr ('=', *a, e)); a = &(*a)->next; }