From 52e1871526e350e91763bf86d44d7c270186d4e3 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Wed, 10 Feb 2016 14:48:22 +0000 Subject: MirLua: avoid access to real _G into script git-svn-id: http://svn.miranda-ng.org/main/trunk@16266 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/mlua_script.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'plugins/MirLua/src') 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"); -- cgit v1.2.3