diff options
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.178 2017/12/08 17:28:25 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.179 2017/12/11 12:43:40 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -243,10 +243,6 @@ void luaD_shrinkstack (lua_State *L) { | |||
243 | int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK; | 243 | int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK; |
244 | if (goodsize > LUAI_MAXSTACK) | 244 | if (goodsize > LUAI_MAXSTACK) |
245 | goodsize = LUAI_MAXSTACK; /* respect stack limit */ | 245 | goodsize = LUAI_MAXSTACK; /* respect stack limit */ |
246 | if (L->stacksize > LUAI_MAXSTACK) /* had been handling stack overflow? */ | ||
247 | luaE_freeCI(L); /* free all CIs (list grew because of an error) */ | ||
248 | else | ||
249 | luaE_shrinkCI(L); /* shrink list */ | ||
250 | /* if thread is currently not handling a stack overflow and its | 246 | /* if thread is currently not handling a stack overflow and its |
251 | good size is smaller than current size, shrink its stack */ | 247 | good size is smaller than current size, shrink its stack */ |
252 | if (inuse <= (LUAI_MAXSTACK - EXTRA_STACK) && | 248 | if (inuse <= (LUAI_MAXSTACK - EXTRA_STACK) && |
@@ -254,6 +250,7 @@ void luaD_shrinkstack (lua_State *L) { | |||
254 | luaD_reallocstack(L, goodsize, 0); /* ok if that fails */ | 250 | luaD_reallocstack(L, goodsize, 0); /* ok if that fails */ |
255 | else /* don't change stack */ | 251 | else /* don't change stack */ |
256 | condmovestack(L,{},{}); /* (change only for debugging) */ | 252 | condmovestack(L,{},{}); /* (change only for debugging) */ |
253 | luaE_shrinkCI(L); /* shrink CI list */ | ||
257 | } | 254 | } |
258 | 255 | ||
259 | 256 | ||