From 1ada32d3a8bee5533cab63f17c4402a20b1b8e23 Mon Sep 17 00:00:00 2001 From: lemon Date: Wed, 10 Dec 2025 11:42:33 +0100 Subject: c: fix compound assignment type conversions when types don't match --- c/c.c | 5 +++-- test/external/lua-5.4.0/src/liblua.a | Bin 527052 -> 0 bytes test/external/lua-5.4.0/src/luac | Bin 264168 -> 0 bytes 3 files changed, 3 insertions(+), 2 deletions(-) delete mode 100644 test/external/lua-5.4.0/src/liblua.a delete mode 100755 test/external/lua-5.4.0/src/luac diff --git a/c/c.c b/c/c.c index 681e71c..c206ec8 100644 --- a/c/c.c +++ b/c/c.c @@ -3484,8 +3484,9 @@ compileexpr(struct function *fn, const struct expr *ex, bool discard) l = genload(fn, ex->ty, adr, ex->qual & QVOLATILE); if ((op != Oadd && op != Osub) || cls != KPTR) { l = cvt(fn, ty, sub[0].ty, l); - r = cvt(fn, ex->ty, sub[1].ty, r); - q = irbinop(fn, op, cls, l, r); + r = cvt(fn, ty, sub[1].ty, r); + q = irbinop(fn, op, type2cls[ty.t], l, r); + q = cvt(fn, ex->ty, ty, q); } else { q = genptroff(fn, op, typesize(typechild(ex->ty)), l, sub[1].ty, r); } diff --git a/test/external/lua-5.4.0/src/liblua.a b/test/external/lua-5.4.0/src/liblua.a deleted file mode 100644 index 9aa32ed..0000000 Binary files a/test/external/lua-5.4.0/src/liblua.a and /dev/null differ diff --git a/test/external/lua-5.4.0/src/luac b/test/external/lua-5.4.0/src/luac deleted file mode 100755 index 00e7a27..0000000 Binary files a/test/external/lua-5.4.0/src/luac and /dev/null differ -- cgit v1.2.3