[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: luaL_error() documented with [-0, +0, v], should be [-0, +1, v] ?
- From: Carsten Fuchs <carsten.fuchs@...>
- Date: Mon, 07 Oct 2013 21:28:18 +0200
Hi all,
at http://www.lua.org/manual/5.2/manual.html#luaL_error the luaL_error() function is
documented with [-0, +0, v], indicating that it does not push anything onto the stack.
However, in fact it pushes the string with the error message.
I came across this because in the C++ function that I leave with luaL_error(), I use for
debugging a very simple stack checker object that checks in its destructor if the stack
is of the same size as in its constructor (plus/minus any expected change).
Even if lua_error() eventually leaves with a longjmp, the Visual C++ compilers run the
destructors of local objects
(http://msdn.microsoft.com/en-us/library/vstudio/yz2ez4as%28v=vs.110%29.aspx), so that
the stack checker object sees one object more on the stack (the error message) than
expected.
As a result, I was wondering if the reference documentation of the various
luaL_...error() functions shouldn't be changed to say [-0, +1, v] instead?
Best regards,
Carsten
--
Cafu - the open-source game and graphics engine for multiplayer 3D action
http://www.cafu.de
- Follow-Ups:
- Re: luaL_error() documented with [-0, +0, v], should be [-0, +1, v] ?, Carsten Fuchs
- Re: luaL_error() documented with [-0, +0, v], should be [-0, +1, v] ?, Roberto Ierusalimschy
- Prev by Date:
RE: Interesting string.find hang with the hyphen operator
- Next by Date:
Re: luaL_error() documented with [-0, +0, v], should be [-0, +1, v] ?
- Previous by thread:
Re: Interesting string.find hang with the hyphen operator
- Next by thread:
Re: luaL_error() documented with [-0, +0, v], should be [-0, +1, v] ?
- Index(es):