No more field 'lua_State.stacksize'

The stack size is derived from 'stack_last', when needed. Moreover,
the handling of stack sizes is more consistent, always excluding the
extra space except when allocating/deallocating the array.
This commit is contained in:
Roberto Ierusalimschy
2020-10-06 15:50:24 -03:00
parent 9ecd446141
commit 5aa36e894f
6 changed files with 29 additions and 26 deletions

2
lvm.c
View File

@@ -1151,7 +1151,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
StkId ra; /* instruction's A register */
vmfetch();
lua_assert(base == ci->func + 1);
lua_assert(base <= L->top && L->top < L->stack + L->stacksize);
lua_assert(base <= L->top && L->top < L->stack_last);
/* invalidate top for instructions not expecting it */
lua_assert(isIT(i) || (cast_void(L->top = base), 1));
vmdispatch (GET_OPCODE(i)) {