lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 9 March 2015 at 15:23, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> In lvm.c if the target of OP_CALL is a Lua function then it is handled
>> by the same invocation of luaV_execute(). When I compile a Lua
>> function I cannot do this so I need to recursively invoke
>> luaV_execute() on the called function. I was wondering if I should
>> directly call luaV_execute() or call luaD_call() - what would be the
>> correct approach?
>
> Probably luaD_call, but depends on your code. luaD_call handles C
> functions, controls the stack depth, and controls yields. Probably
> you want all of them.
>

Thanks. I haven't even started thinking about yields and how to
support them. Just realized what "savedpc" might be for!

How does a function yield? Is it a longjmp?

Regards
Dibyendu