diff options
| author | 2025-10-18 08:43:43 +0200 | |
|---|---|---|
| committer | 2025-10-18 08:43:43 +0200 | |
| commit | ffca6b54a9654005a121c3557bb8b245ae65ce55 (patch) | |
| tree | d312056d397321651cd56f41b3771512b3e11763 | |
| parent | f89e881a3e0c4583ee83699cae677a7c7da6e39e (diff) | |
small thigns
| -rw-r--r-- | amd64/isel.c | 2 | ||||
| -rw-r--r-- | 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); @@ -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: |