From d963c778ebb0e719251b6d05174e656df809a8ba Mon Sep 17 00:00:00 2001 From: Yuichiro NAITO Date: Wed, 22 Oct 2025 15:40:36 +0900 Subject: [PATCH 1/5] The 'table' has supported the 'move' method. --- test/lib/contents.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/contents.lua b/test/lib/contents.lua index a1d8b9b..422920c 100644 --- a/test/lib/contents.lua +++ b/test/lib/contents.lua @@ -77,7 +77,7 @@ do --- 5.2 string +lua>=5.2 end do --- pre-5.2 table +lua<5.2 - check(table, "concat:foreach:foreachi:getn:insert:maxn:remove:sort", "pack:unpack:setn:new") + check(table, "concat:foreach:foreachi:getn:insert:maxn:move:remove:sort", "pack:unpack:setn:new") end do --- 5.2 table +lua>=5.2 From abd9b96c83a71973004b53a359479ae237919000 Mon Sep 17 00:00:00 2001 From: Yuichiro NAITO Date: Wed, 22 Oct 2025 15:42:57 +0900 Subject: [PATCH 2/5] Do not convert a negative number to an unsigned long. It's undefined behavior in C11, and also LuaJIT forces it to be. See the 'lj_num2u64' function for details. --- test/lib/ffi/bit64.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/ffi/bit64.lua b/test/lib/ffi/bit64.lua index d1b47be..caca346 100644 --- a/test/lib/ffi/bit64.lua +++ b/test/lib/ffi/bit64.lua @@ -18,7 +18,7 @@ end do --- smoke band assert(tostring(band(1ll, 1, 1ll, -1)) == "1LL") - assert(tostring(band(1ll, 1, 1ull, -1)) == "1ULL") + assert(tostring(band(1ll, 1, 1ull, -1ll)) == "1ULL") end do --- smoke shl From 9ab27dab66f2ea8bfd7714e672f44f8ea7f68f70 Mon Sep 17 00:00:00 2001 From: Yuichiro NAITO Date: Wed, 22 Oct 2025 15:48:52 +0900 Subject: [PATCH 3/5] Use "h_errno" for BSD libc instead of "errno". The "errno" is a macro to "__errno()" so that it cannot be referred to and rewritten. --- test/lib/ffi/redir.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/lib/ffi/redir.lua b/test/lib/ffi/redir.lua index c492055..acce97d 100644 --- a/test/lib/ffi/redir.lua +++ b/test/lib/ffi/redir.lua @@ -9,9 +9,16 @@ do --- function end do --- variable -windows - ffi.cdef[[ - int redir_bar asm("errno"); - ]] + if (jit.os == "BSD") then + -- Use "h_errno" instead, "errno" isn't defined in BSD libc. + ffi.cdef[[ + int redir_bar asm("h_errno"); + ]] + else + ffi.cdef[[ + int redir_bar asm("errno"); + ]] + end ffi.C.redir_bar = 14 assert(ffi.C.redir_bar == 14) From 4b1db3c613fccb9c0fa56910423abb78ab59afeb Mon Sep 17 00:00:00 2001 From: Yuichiro NAITO Date: Wed, 22 Oct 2025 16:01:27 +0900 Subject: [PATCH 4/5] The "math.mod" has been removed. --- test/lib/contents.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/lib/contents.lua b/test/lib/contents.lua index 422920c..2625199 100644 --- a/test/lib/contents.lua +++ b/test/lib/contents.lua @@ -55,7 +55,7 @@ do --- math end do --- pre-5.2 math +lua<5.2 -compat5.2 - assert(math.mod) + assert(not math.mod) assert(math.log10) end From 304988ccc5861db912854d2afcb5fc3f143bb41b Mon Sep 17 00:00:00 2001 From: Yuichiro NAITO Date: Wed, 22 Oct 2025 16:03:04 +0900 Subject: [PATCH 5/5] The "string.gfind" has been removed. --- test/lib/contents.lua | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/lib/contents.lua b/test/lib/contents.lua index 2625199..dec8475 100644 --- a/test/lib/contents.lua +++ b/test/lib/contents.lua @@ -68,10 +68,6 @@ do --- string check(string, "byte:char:dump:find:format:gmatch:gsub:len:lower:match:rep:reverse:sub:upper", "gfind") end -do --- pre-5.2 string +lua<5.2 -compat5.2 - assert(string.gfind) -end - do --- 5.2 string +lua>=5.2 assert(not string.gfind) end