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

@@ -4358,10 +4358,6 @@ nor modified before a corresponding call to @Lid{lua_closeslot}.
This function should not be called for an index
that is equal to or below an active to-be-closed index.
In the case of an out-of-memory error,
the value in the given index is immediately closed,
as if it was already marked.
Note that, both in case of errors and of a regular return,
by the time the @idx{__close} metamethod runs,
the @N{C stack} was already unwound,