summaryrefslogtreecommitdiff
path: root/plugins/MirLua/src/mlua_script.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-02-10 14:48:22 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-02-10 14:48:22 +0000
commit52e1871526e350e91763bf86d44d7c270186d4e3 (patch)
treeb435bcc548729961c2b50f00eef900a506e80470 /plugins/MirLua/src/mlua_script.cpp
parentc4cd85dfdb9f7582b9037ccc573474a828975abc (diff)
MirLua: avoid access to real _G into script
git-svn-id: http://svn.miranda-ng.org/main/trunk@16266 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/MirLua/src/mlua_script.cpp')
-rw-r--r--plugins/MirLua/src/mlua_script.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/MirLua/src/mlua_script.cpp b/plugins/MirLua/src/mlua_script.cpp
index e0d3cc461b..26c4006e2d 100644
--- a/plugins/MirLua/src/mlua_script.cpp
+++ b/plugins/MirLua/src/mlua_script.cpp
@@ -49,7 +49,9 @@ bool CMLuaScript::Load()
return false;
}
- lua_newtable(L);
+ lua_createtable(L, 0, 1);
+ lua_pushvalue(L, -1);
+ lua_setfield(L, -2, "_G");
lua_createtable(L, 0, 1);
lua_getglobal(L, "_G");
lua_setfield(L, -2, "__index");