From ffca6b54a9654005a121c3557bb8b245ae65ce55 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 18 Oct 2025 08:43:43 +0200 Subject: small thigns --- eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 470ae75..d32cd6e 100644 --- a/eval.c +++ b/eval.c @@ -113,6 +113,7 @@ unop(struct expr *ex, enum evalmode mode) } } if (sub->t != ENUMLIT && !eval(sub, mode)) return 0; + if (sub->t != ENUMLIT) return 0; switch (ex->t) { case ECAST: if (ex->ty.t == TYPTR) { @@ -132,7 +133,7 @@ unop(struct expr *ex, enum evalmode mode) sub->u = ~sub->u; break; case ELOGNOT: - if (isint(sub->ty)) sub->u = !sub->u; + if (isint(sub->ty) || isptrcvt(sub->ty)) sub->u = !sub->u; else assert(isflt(sub->ty)), sub->u = !sub->f; break; default: -- cgit v1.2.3