From 9946adcf5ffcc00b1a8665649b42bdc35bf72d35 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Fri, 15 Feb 2019 19:27:56 -0800 Subject: Fix backwards constant evaluation of float-int casts --- eval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eval.c b/eval.c index ef84943..fdd0f1c 100644 --- a/eval.c +++ b/eval.c @@ -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) { -- cgit v1.2.3