lua-users home
lua-l archive

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

On Sep 3, 2015, at 11:12 AM, Sean Conner <> wrote:

The following function, when invoked, causes a C stack overflow
in Lua 5.3.

local subsystem_mt = {__index =
     for key,bid in ipairs(spec) do
        print("Checking '""' against '"..key.."'")

I may be missing something, but "The following function" does not seem
to be a function. It looks like a table... (Therefore, I do not know
how to invoke it to cause something.)

 All I did was take that code, then add

x = setmetatable({},subsystem_mt)

Isn’t this expected behavior? Since ipairs() respects metamethods (since 5.3), looks like you have an infinite recursion (if you don’t have an item at key 1)?