aboutsummaryrefslogtreecommitdiff
path: root/src/lj_lib.c
diff options
context:
space:
mode:
authorMike Pall <mike>2025-11-27 17:45:17 +0100
committerMike Pall <mike>2025-11-27 17:45:17 +0100
commitf80b349d5490aa289b2925d297f3f3c618977570 (patch)
tree8d8fb0d2beb3e863592139d603ada63e5aa6ce77 /src/lj_lib.c
parent3215838aa744d148e79a8ea0bd7c014e984302cb (diff)
downloadluajit-f80b349d5490aa289b2925d297f3f3c618977570.tar.gz
luajit-f80b349d5490aa289b2925d297f3f3c618977570.tar.bz2
luajit-f80b349d5490aa289b2925d297f3f3c618977570.zip
Unify Lua number to FFI integer conversions.
Phew. #1411
Diffstat (limited to 'src/lj_lib.c')
-rw-r--r--src/lj_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lj_lib.c b/src/lj_lib.c
index 88cb2bdd..d51351b8 100644
--- a/src/lj_lib.c
+++ b/src/lj_lib.c
@@ -349,7 +349,7 @@ int32_t lj_lib_checkintrange(lua_State *L, int narg, int32_t a, int32_t b)
349 ** integer overflow. Overflow detection still works, since all FPUs 349 ** integer overflow. Overflow detection still works, since all FPUs
350 ** return either MININT or MAXINT, which is then out of range. 350 ** return either MININT or MAXINT, which is then out of range.
351 */ 351 */
352 int32_t i = (int32_t)numV(o); 352 int32_t i = lj_num2int(numV(o));
353 if (i >= a && i <= b) return i; 353 if (i >= a && i <= b) return i;
354#if LJ_HASFFI 354#if LJ_HASFFI
355 } else if (tviscdata(o)) { 355 } else if (tviscdata(o)) {