mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Work around LuaJIT issues on aarch64 (#9614)
- Move the text segment below the 47-bit limit, needed for script_exception_wrapper which must be lightuserdata - Replace CUSTOM_RIDX_SCRIPTAPI with full userdata
This commit is contained in:
@@ -30,7 +30,12 @@ ScriptApiBase *ModApiBase::getScriptApiBase(lua_State *L)
|
||||
{
|
||||
// Get server from registry
|
||||
lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI);
|
||||
ScriptApiBase *sapi_ptr = (ScriptApiBase*) lua_touserdata(L, -1);
|
||||
ScriptApiBase *sapi_ptr;
|
||||
#if INDIRECT_SCRIPTAPI_RIDX
|
||||
sapi_ptr = (ScriptApiBase*) *(void**)(lua_touserdata(L, -1));
|
||||
#else
|
||||
sapi_ptr = (ScriptApiBase*) lua_touserdata(L, -1);
|
||||
#endif
|
||||
lua_pop(L, 1);
|
||||
return sapi_ptr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user