aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/fold.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2022-08-13 13:00:37 +0200
committerlemon <lsof@mailbox.org>2022-08-13 13:00:37 +0200
commita4ddca68662f4bc0531763357b4bc00b6c50b456 (patch)
tree97f83407da049732ec97dd2d32ee34e0cd3c8c0f /bootstrap/fold.c
parent5b95abb249604e7df9be1d63b1f3dc85b8f5990b (diff)
target
Diffstat (limited to 'bootstrap/fold.c')
-rw-r--r--bootstrap/fold.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bootstrap/fold.c b/bootstrap/fold.c
index efe1f83..cd72415 100644
--- a/bootstrap/fold.c
+++ b/bootstrap/fold.c
@@ -5,9 +5,9 @@ int fold(struct expr *ex);
static void
numcast(struct expr *ex, const struct type *to) {
- enum typetype t0 = ex->ty->t;
enum typetype t1 = to->t;
- const struct type *from = ex->ty;
+ const struct type *from = ex->ty->t == TYenum ? ex->ty->enu.intty : ex->ty;
+ enum typetype t0 = from->t;
const struct type *uto = unconstify(to);
const struct type *ufrom = unconstify(from);
int size = to->size;