[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: luaL_newstate's panicf uses lua_tostring which can fail, is it safe in theory?
- From: Iurii Belobeev <marsgpl@...>
- Date: Sat, 18 Nov 2023 01:59:40 -0500
Hi,
I'm researching the Lua codebase and I'm a bit confused here:
luaL_newstate sets panicf for a newly created state which uses
lua_tostring in it.
Lua doc states that lua_tostring can fail on memory allocation: [-0,
+0, m] (when it converts number to string?).
In Lua doc §4.4 there's a complicated description, which if I got it
correctly, implies that the panic function should use only API calls
that cannot raise errors.
However when a memory allocation error occurs (is it LUA_ERRMEM?), doc
states that for such errors Lua does not call the message handler.
Is panic function a message handler?
Regards.