From bc970005ce2e258e29a5c315ea4e49f76a66586e Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 12 Feb 2021 13:36:30 -0300 Subject: '__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.) --- lapi.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lapi.h') diff --git a/lapi.h b/lapi.h index 41216b27..9e99cc44 100644 --- a/lapi.h +++ b/lapi.h @@ -42,6 +42,8 @@ #define hastocloseCfunc(n) ((n) < LUA_MULTRET) +/* Map [-1, inf) (range of 'nresults') into (-inf, -2] */ #define codeNresults(n) (-(n) - 3) +#define decodeNresults(n) (-(n) - 3) #endif -- cgit v1.2.3-55-g6feb