> An undefined behavior (signed integer overflow) is happening on execution
> of a Lua chunk below. [...]
Many thanks for the feedback. A simpler example is this:
----------------------------------------------------------------------
-- Lua must be compiled with '-fsanitize=undefined'
-- allocate some space to make gc debt negative (stack space does not
-- invoke GC), and then call 'collectgarbage"step"' with a huge step.
local function deep (n)
if n == 0 then
collectgarbage("step", math.maxinteger)
else
deep(n - 1)
end
end
deep(26)
----------------------------------------------------------------------
BTW, the issue is older than commit 85a3c1699.
-- Roberto