mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-19 17:01:46 +00:00
finally fix chained function calls /properly/. need to make sure /all/ args
get their user count incremented, not just the head of the chain
This commit is contained in:
parent
76a7637b5e
commit
371e92c448
1 changed files with 6 additions and 2 deletions
|
@ -1685,12 +1685,16 @@ function_expr (expr_t *e1, expr_t *e2)
|
|||
} else {
|
||||
*a = e;
|
||||
}
|
||||
// new_binary_expr calls inc_users for both args, but in_users doesn't
|
||||
// walk expression chains so only the first arg expression in the chain
|
||||
// (the last arg in the call) gets its user count incremented, thus
|
||||
// ensure all other arg expressions get their user counts incremented.
|
||||
if (a != &args)
|
||||
inc_users (*a);
|
||||
a = &(*a)->next;
|
||||
}
|
||||
for (i = 0; i < arg_expr_count - 1; i++) {
|
||||
append_expr (call, assign_expr (arg_exprs[i][1], arg_exprs[i][0]));
|
||||
e = arg_exprs[i][1];
|
||||
inc_users (e);
|
||||
}
|
||||
if (arg_expr_count) {
|
||||
e = new_bind_expr (arg_exprs[arg_expr_count - 1][0],
|
||||
|
|
Loading…
Reference in a new issue