diff options
Diffstat (limited to 'ldebug.c')
-rw-r--r-- | ldebug.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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--; |