mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Fix ICE when const-folding doubles
I really need to rework that system.
This commit is contained in:
parent
2a39208069
commit
ea3af84baa
3 changed files with 14 additions and 1 deletions
|
@ -612,6 +612,7 @@ void dump_dot_expr (void *e, const char *filename);
|
|||
void convert_int (expr_t *e);
|
||||
void convert_short (expr_t *e);
|
||||
void convert_short_int (expr_t *e);
|
||||
void convert_double (expr_t *e);
|
||||
void convert_nil (expr_t *e, struct type_s *t);
|
||||
|
||||
expr_t *test_expr (expr_t *e);
|
||||
|
|
|
@ -148,8 +148,12 @@ convert_to_float (expr_t *e)
|
|||
case ev_short:
|
||||
convert_short (e);
|
||||
return e;
|
||||
case ev_double:
|
||||
convert_double (e);
|
||||
return e;
|
||||
default:
|
||||
internal_error (e, 0);
|
||||
internal_error (e, "bad conversion to float: %d",
|
||||
e->e.value->lltype);
|
||||
}
|
||||
break;
|
||||
case ex_symbol:
|
||||
|
|
|
@ -1546,6 +1546,14 @@ convert_short_int (expr_t *e)
|
|||
e->e.value = new_integer_val (integer_val);
|
||||
}
|
||||
|
||||
void
|
||||
convert_double (expr_t *e)
|
||||
{
|
||||
float float_val = expr_double (e);
|
||||
e->type = ex_value;
|
||||
e->e.value = new_float_val (float_val);
|
||||
}
|
||||
|
||||
void
|
||||
convert_nil (expr_t *e, type_t *t)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue