From e8310e8ec900e91366af44791030e6ffc9d414fe Mon Sep 17 00:00:00 2001 From: lemon Date: Fri, 7 Nov 2025 14:10:47 +0100 Subject: c: inc/dec ptr should use ptrdiff integer class --- c/c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'c/c.c') 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); -- cgit v1.2.3