summaryrefslogtreecommitdiff
path: root/src/lj_ctype.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_ctype.c')
-rw-r--r--src/lj_ctype.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_ctype.c b/src/lj_ctype.c
index adbacaec..04e8c35c 100644
--- a/src/lj_ctype.c
+++ b/src/lj_ctype.c
@@ -577,7 +577,7 @@ GCstr *lj_ctype_repr_int64(lua_State *L, uint64_t n, int isunsigned)
if (isunsigned) {
*--p = 'U';
} else if ((int64_t)n < 0) {
- n = (uint64_t)-(int64_t)n;
+ n = ~n+1u;
sign = 1;
}
do { *--p = (char)('0' + n % 10); } while (n /= 10);