Fix C stack remaining check in MODE=tiny

This commit is contained in:
Justine Tunney 2022-07-14 07:23:15 -07:00
parent bcdd5c5f74
commit 28b9d9f781
5 changed files with 11 additions and 7 deletions

View file

@ -336,7 +336,7 @@ static int SerializeTable(lua_State *L, char **buf, int idx,
struct Serializer *z, int depth) {
int rc;
intptr_t rsp, bot;
if ((intptr_t)__builtin_frame_address(0) < GetStackAddr() + PAGESIZE * 2) {
if (UNLIKELY(!HaveStackMemory(PAGESIZE))) {
z->reason = "out of stack";
return -1;
}