aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-09-20 15:56:39 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-09-20 15:56:39 -0300
commit20d42ccaaed9a84783d548d76633a5a38f0091f1 (patch)
tree4d0aae4dfac41956ac35a69ece27d042acd8f4f8 /ldebug.c
parent70d6975018c1f2b8ce34058a4d54a28a3fafca66 (diff)
downloadlua-20d42ccaaed9a84783d548d76633a5a38f0091f1.tar.gz
lua-20d42ccaaed9a84783d548d76633a5a38f0091f1.tar.bz2
lua-20d42ccaaed9a84783d548d76633a5a38f0091f1.zip
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.
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ldebug.c b/ldebug.c
index 9e341f11..d1b47c56 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -847,7 +847,8 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
847 va_start(argp, fmt); 847 va_start(argp, fmt);
848 msg = luaO_pushvfstring(L, fmt, argp); /* format message */ 848 msg = luaO_pushvfstring(L, fmt, argp); /* format message */
849 va_end(argp); 849 va_end(argp);
850 if (isLua(ci)) { /* if Lua function, add source:line information */ 850 if (msg != NULL && isLua(ci)) { /* Lua function? (and no error) */
851 /* add source:line information */
851 luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci)); 852 luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci));
852 setobjs2s(L, L->top.p - 2, L->top.p - 1); /* remove 'msg' */ 853 setobjs2s(L, L->top.p - 2, L->top.p - 1); /* remove 'msg' */
853 L->top.p--; 854 L->top.p--;