mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-22 02:11:19 +00:00
Fix multiple function calls in expressions.
This commit is contained in:
parent
70d18ecfa1
commit
db460155e9
3 changed files with 8 additions and 1 deletions
|
@ -516,6 +516,8 @@ int is_math_op (int op);
|
|||
*/
|
||||
int is_logic (int op);
|
||||
|
||||
int has_function_call (expr_t *e);
|
||||
|
||||
int is_string_val (expr_t *e);
|
||||
int is_float_val (expr_t *e);
|
||||
int is_vector_val (expr_t *e);
|
||||
|
|
|
@ -1488,7 +1488,7 @@ is_logic (int op)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
int
|
||||
has_function_call (expr_t *e)
|
||||
{
|
||||
switch (e->type) {
|
||||
|
|
|
@ -726,6 +726,11 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
|
|||
expr_type_t *expr_type;
|
||||
|
||||
convert_name (e1);
|
||||
if (e1->type == ex_block && e1->e.block.is_call
|
||||
&& has_function_call (e2) && e1->e.block.result) {
|
||||
e = new_temp_def_expr (get_type (e1->e.block.result));
|
||||
e1 = assign_expr (e, e1);
|
||||
}
|
||||
if (e1->type == ex_error)
|
||||
return e1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue