mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-23 10:50:58 +00:00
Run fold_constants on comparison operands.
This is a bit of a workaround to ensure the operands have their types setup correctly. Really, binary_expr needs to handle expression types properly. This fixes the bogus error for comparing the result of pointer subtraction with an integer.
This commit is contained in:
parent
c13f2c2c23
commit
b66cbeeb57
1 changed files with 4 additions and 0 deletions
|
@ -1626,6 +1626,10 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
|
|||
e1 = test_expr (e1);
|
||||
e2 = test_expr (e2);
|
||||
}
|
||||
if (is_compare (op)) {
|
||||
e1 = fold_constants (e1);
|
||||
e2 = fold_constants (e2);
|
||||
}
|
||||
|
||||
if (e1->type == ex_error)
|
||||
return e1;
|
||||
|
|
Loading…
Reference in a new issue