From ffca6b54a9654005a121c3557bb8b245ae65ce55 Mon Sep 17 00:00:00 2001 From: lemon Date: Sat, 18 Oct 2025 08:43:43 +0200 Subject: small thigns --- amd64/isel.c | 2 +- eval.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/amd64/isel.c b/amd64/isel.c index 44f0ff4..2c2e9be 100644 --- a/amd64/isel.c +++ b/amd64/isel.c @@ -405,7 +405,7 @@ sel(struct function *fn, struct instr *ins, struct block *blk, int *curi) else fixarg(&ins->r, ins, blk, curi); break; - case Ocvtf4f8: case Ocvtf8f4: case Ocvtf4s: case Ocvtf8s: + case Ocvtf4f8: case Ocvtf8f4: case Ocvtf4s: case Ocvtf8s: case Ocvts4f: case Ocvts8f: case Oexts1: case Oextu1: case Oexts2: case Oextu2: case Oexts4: case Oextu4: case Ocopy: fixarg(&ins->l, ins, blk, curi); 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