Re: An assertion is triggered in the luaG_runerror()

Roberto Ierusalimschy <[email protected]> Tue, 12 May 2026 16:56:50 -0300
Newsgroups gmane.comp.lang.lua.general
Message-ID <[email protected]>
> an assertion is triggered on execution of a Lua chunk below:
> 
> ./lua -e "
> > local obj = setmetatable({}, {
>   __index = function(l, ...)
>         local _ = l > 1
>   end
> })
> obj:method();
> > "
> lua: ldebug.c:865: void luaG_runerror(lua_State *, const char *, ...): 
> Assertion `(((((&((ci)->func.p)->val)))->tt_) == (((((6) | ((0) << 4))) | 
> (1 << 6))))' failed.
> Aborted (core dumped)

Thanks for the feedback. Indeed, the commit 36c1f6d was wrong:
Although OP_VARARGPREP does not need to be preceded by an "OT"
instruction (it is never preceded by any instruction), it does need
a correct L->top to work properly. (The comment in lopcodes.h:420
is misleading.)

-- Roberto

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/20260512195650.GA412643%40arraial.inf.puc-rio.br.