summaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-05-22 11:40:34 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-05-22 11:40:34 -0300
commit17dbaa8639505c9ad1a9946591f5960123fbd741 (patch)
treec078795bfb4a748ca05faabefafab4e35493714a /lstate.c
parent9514abc2da3525ef4314a8fcf70982ad07319e51 (diff)
downloadlua-17dbaa8639505c9ad1a9946591f5960123fbd741.tar.gz
lua-17dbaa8639505c9ad1a9946591f5960123fbd741.tar.bz2
lua-17dbaa8639505c9ad1a9946591f5960123fbd741.zip
Improvements in the handling of signals
Added 'volatile' to 'l_signalT' variables plus some minor changes.
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lstate.c b/lstate.c
index 8fba70d7..42a48436 100644
--- a/lstate.c
+++ b/lstate.c
@@ -190,14 +190,15 @@ void luaE_freeCI (lua_State *L) {
190*/ 190*/
191void luaE_shrinkCI (lua_State *L) { 191void luaE_shrinkCI (lua_State *L) {
192 CallInfo *ci = L->ci; 192 CallInfo *ci = L->ci;
193 CallInfo *next;
193 CallInfo *next2; /* next's next */ 194 CallInfo *next2; /* next's next */
194 L->nCcalls += L->nci; /* add removed elements back to 'nCcalls' */ 195 L->nCcalls += L->nci; /* add removed elements back to 'nCcalls' */
195 /* while there are two nexts */ 196 /* while there are two nexts */
196 while (ci->next != NULL && (next2 = ci->next->next) != NULL) { 197 while ((next = ci->next) != NULL && (next2 = next->next) != NULL) {
197 luaM_free(L, ci->next); /* free next */ 198 ci->next = next2; /* remove next from the list */
198 L->nci--;
199 ci->next = next2; /* remove 'next' from the list */
200 next2->previous = ci; 199 next2->previous = ci;
200 luaM_free(L, next); /* free next */
201 L->nci--;
201 ci = next2; /* keep next's next */ 202 ci = next2; /* keep next's next */
202 } 203 }
203 L->nCcalls -= L->nci; /* adjust result */ 204 L->nCcalls -= L->nci; /* adjust result */