diff options
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.141 2017/06/29 15:06:44 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.142 2017/10/11 12:38:45 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 | */ |
@@ -153,8 +153,10 @@ static void stack_init (lua_State *L1, lua_State *L) { | |||
153 | ci = &L1->base_ci; | 153 | ci = &L1->base_ci; |
154 | ci->next = ci->previous = NULL; | 154 | ci->next = ci->previous = NULL; |
155 | ci->callstatus = 0; | 155 | ci->callstatus = 0; |
156 | ci->func = L1->top; | 156 | L1->func = ci->func = L1->top; |
157 | setnilvalue(s2v(L1->top++)); /* 'function' entry for this 'ci' */ | 157 | L1->func->stkci.previous = 0; /* end of linked list */ |
158 | setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */ | ||
159 | L1->top++; | ||
158 | ci->top = L1->top + LUA_MINSTACK; | 160 | ci->top = L1->top + LUA_MINSTACK; |
159 | L1->ci = ci; | 161 | L1->ci = ci; |
160 | } | 162 | } |
@@ -215,6 +217,7 @@ static void preinit_thread (lua_State *L, global_State *g) { | |||
215 | G(L) = g; | 217 | G(L) = g; |
216 | L->stack = NULL; | 218 | L->stack = NULL; |
217 | L->ci = NULL; | 219 | L->ci = NULL; |
220 | L->func = NULL; | ||
218 | L->nci = 0; | 221 | L->nci = 0; |
219 | L->stacksize = 0; | 222 | L->stacksize = 0; |
220 | L->twups = L; /* thread has no upvalues */ | 223 | L->twups = L; /* thread has no upvalues */ |