Sandbox causes hang!
Kristoffer Danielsson <[email protected]>
| Newsgroups | gmane.comp.lang.lua.bind.user |
|---|---|
| Message-ID | <[email protected]> |
Luabind 0.9.1 and Lua 5.1.4. Consider this sandbox code:
"load = nil\n
loadfile = nil\n
dofile = nil\n
package.loadlib = nil\n
package.loaders[3] = nil\n
package.loaders[4] = nil\n
package.path = 'C:/Users/Test/Desktop/MyApp/Scripts/?;C:/Users/Test/MyApp/Scripts/?.lua;C:/Users/Test/Desktop/MyApp/Scripts/'\n
"
After executing that, I run this script (located in C:\Users\Test\Desktop\MyApp):
require 'mylib.test' -- C:\Users\Test\Desktop\MyApp\mylib\test.lua does exist!
function foo()
return mylib.test.foo()
end
Then I call "foo":
luabind::call_function<string>(L, "foo");
The script that hangs! It seems to get stuck in the for-loop in lvm.c(385):
case OP_GETGLOBAL: {
TValue g;
TValue *rb = KBx(i);
sethvalue(L, &g, cl->env);
lua_assert(ttisstring(rb));
Protect(luaV_gettable(L, &g, rb, ra)); // I keep getting here. Forever...
continue;
What's wrong with my sandbox code? If I remove the assignment of "package.path", it works! Also, the above seems to work for some scripts with the same logic. Don't get it...
Please help!
------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires
February 28th, so secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user