diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-26 11:13:01 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-04-26 11:13:01 -0300 |
| commit | 969b8c1f14f69c1406f00df3b5f375a9efb7b78f (patch) | |
| tree | 02a8186ecb3689f171a65e45eecb3a11253bf680 | |
| parent | c65605151c5a335baf0a9ea251b19df5b2d3a905 (diff) | |
| download | lua-969b8c1f14f69c1406f00df3b5f375a9efb7b78f.tar.gz lua-969b8c1f14f69c1406f00df3b5f375a9efb7b78f.tar.bz2 lua-969b8c1f14f69c1406f00df3b5f375a9efb7b78f.zip | |
Fixed bug with to-be-closed variables in base C level
To-be-closed variables in C use 'ci.nresults' to code that there is
a variable to be closed in that function. The intialization of the
base C level (the one "running" when calling API functions outside
any Lua call) did not initialize 'ci.nresults', creating (correct)
warnings in valgrind.
| -rw-r--r-- | lstate.c | 2 |
1 files changed, 2 insertions, 0 deletions
| @@ -196,6 +196,8 @@ static void stack_init (lua_State *L1, lua_State *L) { | |||
| 196 | ci->next = ci->previous = NULL; | 196 | ci->next = ci->previous = NULL; |
| 197 | ci->callstatus = CIST_C; | 197 | ci->callstatus = CIST_C; |
| 198 | ci->func = L1->top; | 198 | ci->func = L1->top; |
| 199 | ci->u.c.k = NULL; | ||
| 200 | ci->nresults = 0; | ||
| 199 | setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */ | 201 | setnilvalue(s2v(L1->top)); /* 'function' entry for this 'ci' */ |
| 200 | L1->top++; | 202 | L1->top++; |
| 201 | ci->top = L1->top + LUA_MINSTACK; | 203 | ci->top = L1->top + LUA_MINSTACK; |
