aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-11-07 14:10:47 +0100
committerlemon <lsof@mailbox.org>2025-11-07 17:43:27 +0100
commite8310e8ec900e91366af44791030e6ffc9d414fe (patch)
treeb9a236317f53ea6a4089b25827b1d31825fbce2b
parente1abae83ba4f03e62df5b76afea7441d27b57071 (diff)
c: inc/dec ptr should use ptrdiff integer class
-rw-r--r--c/c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/c/c.c b/c/c.c
index 1dd340f..8530a90 100644
--- a/c/c.c
+++ b/c/c.c
@@ -3255,7 +3255,7 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard)
r = expraddr(fn, sub);
ins.l = genload(fn, sub->ty, r, sub->qual & QVOLATILE);
if (ex->ty.t == TYPTR)
- ins.r = mkintcon(KI4, typesize(typechild(ex->ty)));
+ ins.r = mkintcon(type2cls[targ_sizetype], typesize(typechild(ex->ty)));
else
ins.r = mkref(RICON, 1);
genstore(fn, sub->ty, r, irbinop(fn, ins.op, ins.cls, ins.l, ins.r));
@@ -3267,7 +3267,7 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard)
r = expraddr(fn, sub);
ins.l = genload(fn, sub->ty, r, sub->qual & QVOLATILE);
if (ex->ty.t == TYPTR)
- ins.r = mkintcon(KI4, typesize(typechild(ex->ty)));
+ ins.r = mkintcon(type2cls[targ_sizetype], typesize(typechild(ex->ty)));
else
ins.r = mkref(RICON, 1);
q = irbinop(fn, ins.op, ins.cls, ins.l, ins.r);