diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-15 16:51:31 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-15 16:51:31 -0300 |
commit | a21c89ddc8b91c9fd4888577f7a6c60c4f640795 (patch) | |
tree | 393aa5c8213338b9b72d220bab87c3bdbae20f4f /ltests.c | |
parent | 49b88b1c39fca21f1f55e462e0f549b8187f89d6 (diff) | |
download | lua-a21c89ddc8b91c9fd4888577f7a6c60c4f640795.tar.gz lua-a21c89ddc8b91c9fd4888577f7a6c60c4f640795.tar.bz2 lua-a21c89ddc8b91c9fd4888577f7a6c60c4f640795.zip |
new API function 'lua_mainthread'
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 2.63 2009/06/01 19:09:26 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 2.64 2009/06/10 16:57:53 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -698,6 +698,8 @@ static int doonnewstack (lua_State *L) { | |||
698 | size_t l; | 698 | size_t l; |
699 | const char *s = luaL_checklstring(L, 1, &l); | 699 | const char *s = luaL_checklstring(L, 1, &l); |
700 | int status = luaL_loadbuffer(L1, s, l, s); | 700 | int status = luaL_loadbuffer(L1, s, l, s); |
701 | lua_State *ML = lua_mainthread(L1); | ||
702 | lua_assert(L1 != L && ML != L1 && lua_mainthread(L) == ML); | ||
701 | if (status == LUA_OK) | 703 | if (status == LUA_OK) |
702 | status = lua_pcall(L1, 0, 0, 0); | 704 | status = lua_pcall(L1, 0, 0, 0); |
703 | lua_pushinteger(L, status); | 705 | lua_pushinteger(L, status); |