fix lua5.4 incompat

This commit is contained in:
bol-van committed 2025-11-25 13:26:55 +03:00
1 parent 6a26ea85a3
commit 5e737f314b
3 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -79,7 +79,7 @@ function luaexec(ctx, desync)
end
local fname = desync.func_instance.."_luaexec_code"
if not _G[fname] then
_G[fname] = loadstring(desync.arg.code, fname)
_G[fname] = load(desync.arg.code, fname)
end
-- allow dynamic code to access desync
_G.desync = desync
+1 -1
View File
@@ -1039,7 +1039,7 @@ void lua_pushf_args(const struct ptr_list_head *args, int idx_desync)
else if (val[0]=='#')
{
lua_push_blob(idx_desync, val+1);
lua_Integer len = lua_objlen(params.L, -1);
lua_Integer len = lua_rawlen(params.L, -1);
lua_pop(params.L,1);
lua_pushf_int(var, len);
}
+1
View File
@@ -36,6 +36,7 @@ void lua_do_gc(void);
#if LUA_VERSION_NUM < 502
int lua_absindex(lua_State *L, int idx);
#define lua_rawlen lua_objlen
#endif
// push - create object and push to the stack