summaryrefslogtreecommitdiff
path: root/src/script/cpp_api/s_security.cpp
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2020-04-08 20:14:08 +0200
committerGitHub <noreply@github.com>2020-04-08 20:14:08 +0200
commit659245acc7dcc28e345b8dfa50571102f4f07728 (patch)
treea0bcb88e12627c01e1858c9dc52ecff0326d7675 /src/script/cpp_api/s_security.cpp
parentde73f989eb1397b1103236031fd91309b294583c (diff)
downloadminetest-659245acc7dcc28e345b8dfa50571102f4f07728.tar.gz
minetest-659245acc7dcc28e345b8dfa50571102f4f07728.tar.bz2
minetest-659245acc7dcc28e345b8dfa50571102f4f07728.zip
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
Diffstat (limited to 'src/script/cpp_api/s_security.cpp')
-rw-r--r--src/script/cpp_api/s_security.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/script/cpp_api/s_security.cpp b/src/script/cpp_api/s_security.cpp
index b5abcfb5d..2afa3a191 100644
--- a/src/script/cpp_api/s_security.cpp
+++ b/src/script/cpp_api/s_security.cpp
@@ -499,7 +499,12 @@ bool ScriptApiSecurity::checkPath(lua_State *L, const char *path,
// Get server from registry
lua_rawgeti(L, LUA_REGISTRYINDEX, CUSTOM_RIDX_SCRIPTAPI);
- ScriptApiBase *script = (ScriptApiBase *) lua_touserdata(L, -1);
+ ScriptApiBase *script;
+#if INDIRECT_SCRIPTAPI_RIDX
+ script = (ScriptApiBase *) *(void**)(lua_touserdata(L, -1));
+#else
+ script = (ScriptApiBase *) lua_touserdata(L, -1);
+#endif
lua_pop(L, 1);
const IGameDef *gamedef = script->getGameDef();
if (!gamedef)