aboutsummaryrefslogtreecommitdiff
path: root/ldebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldebug.c')
-rw-r--r--ldebug.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ldebug.c b/ldebug.c
index af3b7583..18bdc595 100644
--- a/ldebug.c
+++ b/ldebug.c
@@ -844,7 +844,9 @@ l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
844 va_start(argp, fmt); 844 va_start(argp, fmt);
845 msg = luaO_pushvfstring(L, fmt, argp); /* format message */ 845 msg = luaO_pushvfstring(L, fmt, argp); /* format message */
846 va_end(argp); 846 va_end(argp);
847 if (msg != NULL && isLua(ci)) { /* Lua function? (and no error) */ 847 if (msg == NULL) /* no memory to format message? */
848 luaD_throw(L, LUA_ERRMEM);
849 else if (isLua(ci)) { /* Lua function? */
848 /* add source:line information */ 850 /* add source:line information */
849 luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci)); 851 luaG_addinfo(L, msg, ci_func(ci)->p->source, getcurrentline(ci));
850 setobjs2s(L, L->top.p - 2, L->top.p - 1); /* remove 'msg' */ 852 setobjs2s(L, L->top.p - 2, L->top.p - 1); /* remove 'msg' */