diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-03-26 17:58:11 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-03-26 17:58:11 -0300 |
commit | 064e406f67c0153999a5246deb1d616b06ee9bb0 (patch) | |
tree | f4483ab6ad6d55484829a0d8a27b8afa1768a36e /lstate.c | |
parent | 5c87f61e6b1567400d2bd8f452939bb948f16dda (diff) | |
download | lua-064e406f67c0153999a5246deb1d616b06ee9bb0.tar.gz lua-064e406f67c0153999a5246deb1d616b06ee9bb0.tar.bz2 lua-064e406f67c0153999a5246deb1d616b06ee9bb0.zip |
no more fenvs!
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.73 2010/03/25 13:06:36 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.74 2010/03/25 19:37:23 roberto Exp roberto $ |
3 | ** Global State | 3 | ** Global State |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -118,9 +118,6 @@ static void freestack (lua_State *L) { | |||
118 | static int ccall (lua_State *L) { | 118 | static int ccall (lua_State *L) { |
119 | lua_CFunction f = *(lua_CFunction *)lua_touserdata(L, 1); | 119 | lua_CFunction f = *(lua_CFunction *)lua_touserdata(L, 1); |
120 | lua_remove(L, 1); /* remove f from stack */ | 120 | lua_remove(L, 1); /* remove f from stack */ |
121 | /* restore original environment for 'ccall' */ | ||
122 | lua_pushglobaltable(L); | ||
123 | lua_replace(L, LUA_ENVIRONINDEX); | ||
124 | return f(L); | 121 | return f(L); |
125 | } | 122 | } |
126 | 123 | ||
@@ -139,7 +136,7 @@ static void init_registry (lua_State *L, global_State *g) { | |||
139 | setthvalue(L, &mt, L); | 136 | setthvalue(L, &mt, L); |
140 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_MAINTHREAD), &mt); | 137 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_MAINTHREAD), &mt); |
141 | /* registry[LUA_RIDX_CCALL] = ccall */ | 138 | /* registry[LUA_RIDX_CCALL] = ccall */ |
142 | cp = luaF_newCclosure(L, 0, g->l_gt); | 139 | cp = luaF_newCclosure(L, 0); |
143 | cp->c.f = ccall; | 140 | cp->c.f = ccall; |
144 | setclvalue(L, &mt, cp); | 141 | setclvalue(L, &mt, cp); |
145 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_CCALL), &mt); | 142 | setobj2t(L, luaH_setint(L, registry, LUA_RIDX_CCALL), &mt); |