lua-users home
lua-l archive

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


Thank you for your reply!

You are right about this, I did a proper research and found alot of interesting bugs in this code. To begin with, _TRACEBACK on top stuff was dropped already in early Lua 5.0. Few wrong calls to multiple API functions which completely broke the Lua stack. I wonder how this code could actually work all this time until Lua 5.4.3. With other words there were made changes to Lua to protect itself even better, which is just great! However, I corrected all the errors and made a proper cleanup in my code, everything seems to work smooth now. Thank you everyone for great help!

Regards.

On 2022-12-06 00:07, Patrick Kurth wrote:
This function is a bit weird. You emtpy the stack and then get the
number of stack items (line 262, into 'base'), which will always be 0.
Then you push "_TRACEBACK" and the global table, only to (I guess
that's what you want to do) reverse the order of those two.
First of all you call lua_insert with index 0, which is not valid.
Secondly, why use lua_insert at all when you can just push the stuff
you need in the right order?
Anyway, I'd start with checking the indices, maybe I'm missing
something here, but this caught my attention.

Kind regards,
Patrick