aboutsummaryrefslogtreecommitdiffhomepage
path: root/eval.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-10-18 08:43:43 +0200
committerlemon <lsof@mailbox.org>2025-10-18 08:43:43 +0200
commitffca6b54a9654005a121c3557bb8b245ae65ce55 (patch)
treed312056d397321651cd56f41b3771512b3e11763 /eval.c
parentf89e881a3e0c4583ee83699cae677a7c7da6e39e (diff)
small thigns
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 2 insertions, 1 deletions
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: