diff options
author | Michael Forney <mforney@mforney.org> | 2019-02-15 19:27:56 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-02-15 19:52:18 -0800 |
commit | 9946adcf5ffcc00b1a8665649b42bdc35bf72d35 (patch) | |
tree | 336b15446fa9379e1a2bd9853320c9e7d58a2601 | |
parent | 8ffedb1f24804c9c13121a12b3802610f2b6f9df (diff) |
Fix backwards constant evaluation of float-int casts
-rw-r--r-- | eval.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -51,9 +51,9 @@ eval(struct expression *expr) if (l->kind == EXPRCONST) { expr->kind = EXPRCONST; if (typeprop(l->type) & PROPINT && typeprop(expr->type) & PROPFLOAT) - expr->constant.i = l->constant.f; - else if (typeprop(l->type) & PROPFLOAT && typeprop(expr->type) & PROPINT) expr->constant.f = l->constant.i; + else if (typeprop(l->type) & PROPFLOAT && typeprop(expr->type) & PROPINT) + expr->constant.i = l->constant.f; else expr->constant = l->constant; } else if (l->type->kind == TYPEPOINTER && expr->type->kind == TYPEPOINTER) { |