From 20d42ccaaed9a84783d548d76633a5a38f0091f1 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 20 Sep 2024 15:56:39 -0300 Subject: No errors in 'luaO_pushvfstring' Any call to 'va_start' must have a corresponding call to 'va_end'; so, functions called between them (luaO_pushvfstring in particular) cannot raise errors. --- lapi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index 7980ead0..fffd7d26 100644 --- a/lapi.c +++ b/lapi.c @@ -587,6 +587,8 @@ LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) { ret = luaO_pushvfstring(L, fmt, argp); va_end(argp); luaC_checkGC(L); + if (ret == NULL) /* error? */ + luaD_throw(L, LUA_ERRMEM); lua_unlock(L); return ret; } -- cgit v1.2.3-55-g6feb