aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2023-05-31 22:23:57 +0200
committerlemon <lsof@mailbox.org>2023-05-31 22:23:57 +0200
commite2d649f575c31d96f2fc7595594ba8c360f7bdc5 (patch)
treea82b4f231280c2258d11bc094a00305b76724dc9
parent380e42a08b0737e13e6e322fcfd8ba4e9f7c99db (diff)
fix cmp exprs
-rw-r--r--parse.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 8a030ce..f243733 100644
--- a/parse.c
+++ b/parse.c
@@ -1378,12 +1378,13 @@ exprvalue(struct function *fn, const struct expr *ex)
swp = 1;
Cmp:
ty = cvtarith(sub[0].ty, sub[1].ty);
+ if (!ty.t) ty.t = TYPTR;
if (isunsigned(ty) && in_range(ins.op, Olth, Olte))
ins.op += Oulth - Olth;
ins.l = exprvalue(fn, &sub[0^swp]);
- ins.l = cvt(fn, ex->ty.t, ty.t, ins.l);
+ ins.l = cvt(fn, ty.t, sub[0^swp].ty.t, ins.l);
ins.r = exprvalue(fn, &sub[1^swp]);
- ins.r = cvt(fn, ex->ty.t, ty.t, ins.r);
+ ins.r = cvt(fn, ty.t, sub[1^swp].ty.t, ins.r);
ins.cls = cls;
return addinstr(fn, ins);
break;