lua-users home
lua-l archive

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

On Mon, Dec 13, 2004 at 11:05:39AM -0600, Tim Gogolin wrote:
> What is the expected behavior of lua_getinfo(L, "n", &ar) if the name 
> information has been stripped from the lua code via the "luac -s" 
> command line compiler?
> I had been hoping to merely receive useless or empty strings, but 
> instead my program is crashing in lua_getinfo() as auxgetinfo() passes 
> NULL as the address of the buffer for getfuncname to write into.

Sorry, this is a bug. I think that the problem is at ldebug.c:480:
        *name = getstr(p->upvalues[u]);

A quick fix is
        *name = (p->upvalues==NULL) ? "?" : getstr(p->upvalues[u]);

Thanks for spotting this.