|
A potential solution is to ensure that the luaD_hookcall is not executed during VM yielding, thereby preventing it from being invoked repeatedly.
> A correction
Thanks for the feedback.
The bug seems to be caused by the iteraction between both hooks. It
seems to go like that:
- The function starts: As the function is in its first instruction,
it calls the Call hook.
- Then, it checks the Count hook. As its counter goes to zero,
it calls the Count hook *and* does not move the program counter,
because it does not execute the current instruction yet.
- When the thread resumes, it is (yet) in the first instruction of
the current function, so it calls the Call hook again.
-- Roberto