'__close' methods can yield in the return of a C function

When, inside a coroutine, a C function with to-be-closed slots return,
the corresponding metamethods can yield. ('__close' metamethods called
through 'lua_closeslot' still cannot yield, as there is no continuation
to go when resuming.)
This commit is contained in:
Roberto Ierusalimschy
2021-02-12 13:36:30 -03:00
parent f79ccdca9b
commit bc970005ce
5 changed files with 131 additions and 34 deletions

View File

@@ -3102,6 +3102,9 @@ Close the to-be-closed slot at the given index and set its value to @nil.
The index must be the last index previously marked to be closed
@see{lua_toclose} that is still active (that is, not closed yet).
A @Lid{__close} metamethod cannot yield
when called through this function.
(Exceptionally, this function was introduced in release 5.4.3.
It is not present in previous 5.4 releases.)