lua-users home
lua-l archive

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


Hi Egor,

> So, the code actually checks the parameters/registers of the "func" stack frame.

Correct; my guess was wrong. Thank you for the explanation.

Paul.

On Sun, Aug 23, 2020 at 9:20 AM Egor Skriptunoff
<egor.skriptunoff@gmail.com> wrote:
>
> On Sun, Aug 23, 2020 at 6:18 PM Paul K wrote:
>>
>> It looks like it checks the "line" parameter of the debug hook (it
>> will be the second function from the top),
>
>
> No.
> The hook function is the first function from the top.
> The second function from the top is the "func" (the function
> passed as an argument for is_C_function).
> It could be verified by inserting the following statement inside the hook
> print("Stack level 2 is 'func':", debug.getinfo(2).func == func)
>
> So, the code actually checks the parameters/registers of the "func" stack frame.