lua-users home
lua-l archive

Re: cannot receive LUA_HOOKTAILRET event of tail call afterdebug.sethook

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


The lua version used is lua5.1.4
2016年06月05日

cx0cx2001

发件人: cx0cx2001
发送时间: 2016年06月05日 22:04:41
收件人: lua-l
抄送:
主题: cannot receive LUA_HOOKTAILRET event of tail call afterdebug.sethook
<code>
function hook(event)
print(event);
end
function test1()
end
function test()
return test1();
end
debug.sethook(hook, "cr");
test();
</code>
The output of the above code is following:
call
call
return
The count of return hook is not same as the count of call hook.
I found that the return or tailretun event is missing when there is tail call.
Because of this bug, it's impossible to collect the function's execute time(between call hook and return hook) of lua code.
2016年06月05日

cx0cx2001

AltStyle によって変換されたページ (->オリジナル) /