diff options
| author | 2025-12-19 12:58:03 +0100 | |
|---|---|---|
| committer | 2025-12-19 12:58:03 +0100 | |
| commit | 13b158caadb1d649101f9ea4c865fc67daba22d5 (patch) | |
| tree | eb339fe466d0b201f765cacb99e5c744444bf961 | |
| parent | 95c43247e02b12c86114d53e95eec2c4988a9e03 (diff) | |
c: fix incr/decr codegen for floats
| -rw-r--r-- | c/c.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -3441,7 +3441,7 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard) if (ex->ty.t == TYPTR) r = mkintcon(type2cls[targ_sizetype], typesize(typechild(ex->ty))); else - r = mkref(RICON, 1); + r = isflt(ex->ty) ? mkfltcon(type2cls[ex->ty.t], 1.0) : mkref(RICON, 1); bitsiz = 0; if (sub[0].t == EGETF && (bitsiz = sub->fld.bitsiz)) { union ref tmp; @@ -3462,7 +3462,7 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard) if (ex->ty.t == TYPTR) r = mkintcon(type2cls[targ_sizetype], typesize(typechild(ex->ty))); else - r = mkref(RICON, 1); + r = isflt(ex->ty) ? mkfltcon(type2cls[ex->ty.t], 1.0) : mkref(RICON, 1); if (sub[0].t == EGETF && (bitsiz = sub->fld.bitsiz)) { ty = ex->ty; goto CompoundBitf; |