diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-11-03 16:34:36 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-11-03 16:34:36 -0300 |
commit | 58216600eba27d472de33dbb89e2f3e629bf8a59 (patch) | |
tree | 9504237097bb72548e5e7b66b753dc23056330a8 /ltests.c | |
parent | 94cbe4651156a84dd9114d7daaa61acd050adbe0 (diff) | |
download | lua-58216600eba27d472de33dbb89e2f3e629bf8a59.tar.gz lua-58216600eba27d472de33dbb89e2f3e629bf8a59.tar.bz2 lua-58216600eba27d472de33dbb89e2f3e629bf8a59.zip |
'luaL_newstate' should not allocate extra memory
The allocation of a userdata for the state of the warn system can
cause a panic if it fails; 'luaL_ref' also can fail. This commit
re-implements the warn system so that it does not need an explicit
state. Instead, the system uses different functions to represent
the different states.
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -863,7 +863,7 @@ static int alloc_failnext (lua_State *L) { | |||
863 | l_memcontrol.failnext = 1; | 863 | l_memcontrol.failnext = 1; |
864 | return 0; | 864 | return 0; |
865 | } | 865 | } |
866 | 866 | ||
867 | 867 | ||
868 | static int settrick (lua_State *L) { | 868 | static int settrick (lua_State *L) { |
869 | if (ttisnil(obj_at(L, 1))) | 869 | if (ttisnil(obj_at(L, 1))) |