aboutsummaryrefslogtreecommitdiff
path: root/lcode.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-04-23 11:55:04 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-04-23 11:55:04 -0300
commite05590591410a5e007a1e3f1691f6c1cf9d8fe45 (patch)
treecd13636363ff66a9d56f979293e353975c36b77b /lcode.c
parent9b014d4bcd4ebadb523f1c1a1d38148d8526e5ed (diff)
downloadlua-e05590591410a5e007a1e3f1691f6c1cf9d8fe45.tar.gz
lua-e05590591410a5e007a1e3f1691f6c1cf9d8fe45.tar.bz2
lua-e05590591410a5e007a1e3f1691f6c1cf9d8fe45.zip
New macro 'pushvfstring'HEADmaster
Helps to ensure that 'luaO_pushvfstring' is being called correctly, with an error check after closing the vararg list with 'va_end'.
Diffstat (limited to 'lcode.c')
-rw-r--r--lcode.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lcode.c b/lcode.c
index d22a081a..e8b9bb5d 100644
--- a/lcode.c
+++ b/lcode.c
@@ -43,11 +43,7 @@ static int codesJ (FuncState *fs, OpCode o, int sj, int k);
43l_noret luaK_semerror (LexState *ls, const char *fmt, ...) { 43l_noret luaK_semerror (LexState *ls, const char *fmt, ...) {
44 const char *msg; 44 const char *msg;
45 va_list argp; 45 va_list argp;
46 va_start(argp, fmt); 46 pushvfstring(ls->L, argp, fmt, msg);
47 msg = luaO_pushvfstring(ls->L, fmt, argp);
48 va_end(argp);
49 if (msg == NULL) /* error? */
50 luaD_throw(ls->L, LUA_ERRMEM);
51 ls->t.token = 0; /* remove "near <token>" from final message */ 47 ls->t.token = 0; /* remove "near <token>" from final message */
52 luaX_syntaxerror(ls, msg); 48 luaX_syntaxerror(ls, msg);
53} 49}