From 58216600eba27d472de33dbb89e2f3e629bf8a59 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 3 Nov 2020 16:34:36 -0300 Subject: '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. --- ltests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ltests.c') diff --git a/ltests.c b/ltests.c index 7e3a389a..2020131f 100644 --- a/ltests.c +++ b/ltests.c @@ -863,7 +863,7 @@ static int alloc_failnext (lua_State *L) { l_memcontrol.failnext = 1; return 0; } - + static int settrick (lua_State *L) { if (ttisnil(obj_at(L, 1))) -- cgit v1.2.3-55-g6feb