[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: confuse about 'lua_yieldk'
- From: Roberto Ierusalimschy <roberto@...>
- Date: Wed, 16 Dec 2015 14:10:42 -0200
> 703 if ((ci->u.c.k = k) != NULL) /* is there a continuation? */
>
> 704 ci->u.c.ctx = ctx; /* save context */
>
> 705 ci->func = L->top - nresults - 1; /* protect stack below results
> */
> 706 luaD_throw(L, LUA_YIELD);
> 707 }
>
> why should protect stack below results, somewhere can change the stack
> value?
'lua_resume' assumes that everything on the stack are results from
yield. 'protect' here means to avoid those values being considered
results to 'resume'.
-- Roberto