Merge pull request #6 from mq1n/patch-1

fix pointer precision loss for x64 pointers in Lua
This commit is contained in:
d1str4ught
2025-09-13 14:33:48 +02:00
committed by GitHub

View File

@@ -1562,7 +1562,7 @@ namespace quest
{
lua_getglobal(qs.co, "__codecache");
// stack : __codecache
lua_pushnumber(qs.co, (long)code);
lua_pushlightuserdata(qs.co, (void*)code);
// stack : __codecache (codeptr)
lua_rawget(qs.co, -2);
// stack : __codecache (compiled-code)
@@ -1577,7 +1577,7 @@ namespace quest
// stack : __codecache
luaL_loadbuffer(qs.co, code, code_size, quest_name.c_str());
// stack : __codecache (compiled-code)
lua_pushnumber(qs.co, (long)code);
lua_pushlightuserdata(qs.co, (void*)code);
// stack : __codecache (compiled-code) (codeptr)
lua_pushvalue(qs.co, -2);
// stack : __codecache (compiled-code) (codeptr) (compiled_code)