src/slob_pd.c:82: calling slob_progress failed, lua_exec() expected 1 items on stack, but it has 3
src/slob_pd.c:82: calling slob_progress failed, lua_exec() expected 1 items on stack, but it has 5
[...]
src/slob_pd.c:82: calling slob_progress failed, lua_exec() expected 1 items on stack, but it has 21
main.lua:140: stack overflow at Core/minilua/lapi.c:638
stack traceback:
[C]: in method 'get'
main.lua:140: in function 'openChapter'
No idea what's going wrong here, this seems like the simplest possible use case for callFunction. Is it not supposed to be called from within a Lua bound function? (If not there, then where?)
Onceagain, just giving us lua.h functions would make this less complex
Hmm, thanks for taking a look at it. On second thought I'm wondering if this is related to my l_get function being part of a table, passed into Lua with registerClass (which I neglected to mention in my example code.) I already refactored my game so I'll be able to ship it without worrying about this bug, but in a few days I'll come back and see if I can make a properly stripped down test case.
I was able to reproduce this error by calling Lua -> C -> Lua in that order.
In this test, the error occurs only when the C function call has arguments.
local gfx = playdate.graphics
function LuaFunction()
print("[Called] LuaFunction.")
end
local _first = true
function playdate.update()
if _first then
print("\n[Call] CFunction argc:0")
CFunction()
print("\n[Call] CFunction argc:1")
CFunction("hoge")
_first = false
end
end