diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-05-22 11:40:34 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-05-22 11:40:34 -0300 |
commit | 17dbaa8639505c9ad1a9946591f5960123fbd741 (patch) | |
tree | c078795bfb4a748ca05faabefafab4e35493714a /lstate.c | |
parent | 9514abc2da3525ef4314a8fcf70982ad07319e51 (diff) | |
download | lua-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.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -190,14 +190,15 @@ void luaE_freeCI (lua_State *L) { | |||
190 | */ | 190 | */ |
191 | void luaE_shrinkCI (lua_State *L) { | 191 | void 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 */ |