[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Missing error message in panic handler / calling luaD_throw without error message on stack
- From: Jan Behrens <jbe-lua-l@...>
- Date: Mon, 10 Nov 2014 15:39:03 +0100
On Mon, 10 Nov 2014 11:18:57 -0200
Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> > > Looking into the source code of Lua 5.2.3, I found that in line
> > > #93 of lmem.c, the function luaD_throw(L, LUA_ERRMEM) is called
> > > #without
> > > pushing first an error message on top of the stack. Other calls of
> > > luaD_throw, however, push an error message to the stack, e.g.
> > > function lexerror() in llex.c, line #110 or function checkmode()
> > > in ldo.c, line #635.
> > >
> > > Is this a bug?
> >
> > There seems to be a bug, but not there. As lhf pointed out, memory
> > errors are handled differently; the error message for them is
> > pushed in ldo.c, function 'seterrorobj'.
>
> The bug is that 'seterrorobj' is not called in the case of a panic.
> (For protected calls, the error message "not enough memory" is
> returned correctly.)
>
> -- Roberto
>
Thank you for this information. I might just push an error string on
top of the stack as a workaround before calling lua_newuserdata() until
this bug has been fixed.
Regards
Jan Behrens
--
Public Software Group e. V.
Johannisstr. 12, 10117 Berlin, Germany
www.public-software-group.org
vorstand at public-software-group.org
eingetragen in das Vereinregister
des Amtsgerichtes Charlottenburg
Registernummer: VR 28873 B
Vorstände (einzelvertretungsberechtigt):
Jan Behrens
Axel Kistner
Andreas Nitsche
Björn Swierczek