diff --git a/src/lj_strfmt_num.c b/src/lj_strfmt_num.c index 79bc7610..04769258 100644 --- a/src/lj_strfmt_num.c +++ b/src/lj_strfmt_num.c @@ -480,7 +480,7 @@ static char *lj_strfmt_wfnum(SBuf *sb, SFormat sf, lua_Number n, char *p) if ((prec | (sf & STRFMT_F_ALT))) { /* Emit fractional part. */ p[1] = '.'; p += 2; - prec -= (q - p); p = q; /* Account for the digits already emitted. */ + prec -= (MSize)(q - p); p = q; /* Account for digits already emitted. */ /* Then emit chunks of 9 digits (this may emit 8 digits too many). */ for (i = ndhi; (int32_t)prec > 0 && i != ndlo; prec -= 9) { i = (i - 1) & 0x3f; diff --git a/src/vm_x64.dasc b/src/vm_x64.dasc index a6b6853e..63ed2cb7 100644 --- a/src/vm_x64.dasc +++ b/src/vm_x64.dasc @@ -250,11 +250,11 @@ |// Macros to clear or set tags. |.macro cleartp, reg; shl reg, 17; shr reg, 17; .endmacro |.macro settp, reg, tp -| mov64 ITYPE, ((int64_t)tp<<47) +| mov64 ITYPE, ((uint64_t)tp<<47) | or reg, ITYPE |.endmacro |.macro settp, dst, reg, tp -| mov64 dst, ((int64_t)tp<<47) +| mov64 dst, ((uint64_t)tp<<47) | or dst, reg |.endmacro |.macro setint, reg