Simpler handling of errors when creating tbc variables

New field 'lua_State.ptbc' keeps to-be-closed variable until its
upvalue is created, so that it can be closed in case of a
memory-allocation error.
This commit is contained in:
Roberto Ierusalimschy
2021-01-19 10:03:13 -03:00
parent d0f34d9137
commit 6ccd24eff5
6 changed files with 25 additions and 35 deletions

View File

@@ -308,6 +308,7 @@ struct lua_State {
int basehookcount;
int hookcount;
volatile l_signalT hookmask;
StkId ptbc; /* pending to-be-closed variable */
};