diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-12 13:36:30 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2021-02-12 13:36:30 -0300 |
commit | bc970005ce2e258e29a5c315ea4e49f76a66586e (patch) | |
tree | 5575ca66aeddad2036df74f38fa2bed217c2801e /lapi.h | |
parent | f79ccdca9bbe9d486d91a44a4464b99ce38de0e2 (diff) | |
download | lua-bc970005ce2e258e29a5c315ea4e49f76a66586e.tar.gz lua-bc970005ce2e258e29a5c315ea4e49f76a66586e.tar.bz2 lua-bc970005ce2e258e29a5c315ea4e49f76a66586e.zip |
'__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.)
Diffstat (limited to 'lapi.h')
-rw-r--r-- | lapi.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -42,6 +42,8 @@ | |||
42 | 42 | ||
43 | #define hastocloseCfunc(n) ((n) < LUA_MULTRET) | 43 | #define hastocloseCfunc(n) ((n) < LUA_MULTRET) |
44 | 44 | ||
45 | /* Map [-1, inf) (range of 'nresults') into (-inf, -2] */ | ||
45 | #define codeNresults(n) (-(n) - 3) | 46 | #define codeNresults(n) (-(n) - 3) |
47 | #define decodeNresults(n) (-(n) - 3) | ||
46 | 48 | ||
47 | #endif | 49 | #endif |