Open Charliechen1 opened 6 years ago
@Charliechen1 ,
Please, check the comment I wrote into Issue #132.
I guess the debug package has the sethook()
function.
But I didn't test it on go-lua. I'll test it later today!
Using the Lua "C" library, I was able to limite the instructions count (IC). But the dangerous function should bee called with pcall() inside the Lua script, to avoid errors. And hooking into IC event, we can stop the loop.
I also need such feature into my own project with go-lua.
What if the Lua script is something like
while true do end
Is there any method that could kill such running lua script?