diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-17 11:28:06 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-04-17 11:28:06 -0300 |
| commit | 4f88418170d298b065a7f71d86b1127153919ae9 (patch) | |
| tree | 7e9c403890b4fe7ac13d501242cfdd967bf0285e /lapi.c | |
| parent | 311e9f3ceb19eefe30a1b5f90dfad9898d8bac74 (diff) | |
| download | lua-4f88418170d298b065a7f71d86b1127153919ae9.tar.gz lua-4f88418170d298b065a7f71d86b1127153919ae9.tar.bz2 lua-4f88418170d298b065a7f71d86b1127153919ae9.zip | |
'CallInfo' stack implemented as double-linked list instead of an array
Diffstat (limited to 'lapi.c')
| -rw-r--r-- | lapi.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lapi.c,v 2.73 2009/03/30 18:39:20 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.74 2009/04/08 18:04:33 roberto Exp roberto $ |
| 3 | ** Lua API | 3 | ** Lua API |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -72,7 +72,7 @@ static TValue *index2adr (lua_State *L, int idx) { | |||
| 72 | 72 | ||
| 73 | 73 | ||
| 74 | static Table *getcurrenv (lua_State *L) { | 74 | static Table *getcurrenv (lua_State *L) { |
| 75 | if (L->ci == L->base_ci) /* no enclosing function? */ | 75 | if (L->ci->previous == NULL) /* no enclosing function? */ |
| 76 | return hvalue(gt(L)); /* use global table as environment */ | 76 | return hvalue(gt(L)); /* use global table as environment */ |
| 77 | else { | 77 | else { |
| 78 | Closure *func = curr_func(L); | 78 | Closure *func = curr_func(L); |
| @@ -185,7 +185,7 @@ LUA_API void lua_replace (lua_State *L, int idx) { | |||
| 185 | StkId o; | 185 | StkId o; |
| 186 | lua_lock(L); | 186 | lua_lock(L); |
| 187 | /* explicit test for incompatible code */ | 187 | /* explicit test for incompatible code */ |
| 188 | if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci) | 188 | if (idx == LUA_ENVIRONINDEX && L->ci->previous == NULL) |
| 189 | luaG_runerror(L, "no calling environment"); | 189 | luaG_runerror(L, "no calling environment"); |
| 190 | api_checknelems(L, 1); | 190 | api_checknelems(L, 1); |
| 191 | o = index2adr(L, idx); | 191 | o = index2adr(L, idx); |
